:root {
    --primary-color: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #3B82F6;
    --secondary-color: #64748B;
    --success-color: #10B981;
    --error-color: #EF4444;
    --bg-light: #F8FAFC;
    --bg-card: #FFFFFF;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
    color: var(--text-dark);
}

.container {
    width: 100%;
    max-width: 700px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto 10px auto;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1E293B 0%, #2563EB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.logo p {
    color: var(--text-muted);
    font-size: 1rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 1rem;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.domain-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.domain-input-group input {
    flex: 1;
}

.domain-suffix {
    padding: 14px 18px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-dark);
    font-weight: 600;
    white-space: nowrap;
}

.domain-dot {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.2rem;
    padding: 0 4px;
}


.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid var(--error-color);
    color: var(--text-dark);
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid var(--success-color);
    color: var(--text-dark);
}

.alert-info {
    background: rgba(59, 130, 246, 0.2);
    border: 2px solid #3B82F6;
    color: var(--text-dark);
}

.link-text {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
}

.link-text a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.link-text a:hover {
    color: white;
    text-decoration: underline;
}

.otp-display {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid var(--success-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
}

.otp-display p {
    margin-bottom: 10px;
    color: var(--text-light);
}

.otp-code {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--success-color);
    font-family: 'Courier New', monospace;
}

.profile-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.profile-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-info-item:last-child {
    border-bottom: none;
}

.profile-info-label {
    font-weight: 600;
    color: var(--text-muted);
}

.profile-info-value {
    color: var(--text-light);
    font-weight: 600;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 600px) {
    .card {
        padding: 30px 24px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .domain-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .domain-suffix {
        text-align: center;
    }
}

/* Input number styling for OTP */
input[type="text"].otp-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 4px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* Radio button styling */
.radio-group {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.radio-option:hover label {
    color: var(--primary-color);
}

/* Dashboard styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header .logo {
    margin-bottom: 0;
    text-align: right;
}

.domains-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.domain-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.domain-info {
    flex: 1;
}

.domain-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.domain-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.domain-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.domain-link::after {
    content: "↗";
    font-size: 0.9rem;
    opacity: 0.6;
}


.domain-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.domain-type {
    font-size: 0.9rem;
}

.social-media-link {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.social-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-custom {
    background: rgba(139, 92, 246, 0.2);
    color: #7C3AED;
    border: 1px solid #7C3AED;
}

.badge-temp {
    background: rgba(59, 130, 246, 0.2);
    color: #2563EB;
    border: 1px solid #2563EB;
}

.badge-trial {
    background: rgba(59, 130, 246, 0.2);
    color: #2563EB;
    border: 1px solid #2563EB;
    font-weight: 700;
}

.badge-subscribed {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    border: 1px solid #059669;
    font-weight: 700;
}

.badge-active {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    border: 1px solid #059669;
    font-weight: 700;
}

.badge-expired {
    background: rgba(239, 68, 68, 0.2);
    color: #DC2626;
    border: 1px solid #DC2626;
    font-weight: 700;
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #DC2626;
    border: 1px solid #DC2626;
    font-weight: 700;
}

.domain-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.domain-status {
    display: flex;
    gap: 8px;
    align-items: center;
}

.domain-expiry {
    margin-top: 4px;
}

.btn-subscribe {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-subscribe:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

.btn-subscribe:active {
    transform: translateY(0);
}


.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 2px solid var(--error-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: var(--error-color);
    color: white;
    transform: translateY(-2px);
}

/* reCAPTCHA styling */
.g-recaptcha {
    display: flex;
    justify-content: center;
    transform: scale(0.95);
    transform-origin: center;
}

@media (max-width: 600px) {
    .g-recaptcha {
        transform: scale(0.85);
    }

    .radio-group {
        flex-direction: column;
        gap: 12px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 20px;
    }

    .dashboard-header .logo {
        text-align: center;
    }

    .domain-item {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .btn-delete {
        width: 100%;
    }

    .domain-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .btn-edit,
    .btn-delete {
        flex: 1;
    }
}

/* Edit button */
.btn-edit {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
}

.btn-edit:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.domain-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.modal-actions .btn {
    flex: 1;
    margin-top: 0;
}

@media (max-width: 600px) {
    .modal-content {
        padding: 30px 24px;
        width: 95%;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100% !;
    }
}

/* Subscription Page Styles */
.subscribe-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.back-link {
    position: absolute;
    top: 0;
    right: 0;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-dark);
}

.subscribe-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.domain-display {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    margin: 20px 0;
}

.domain-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 8px;
}

.domain-name-large {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.status-message {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 15px;
}

.status-message.expired {
    color: var(--error-color);
    font-weight: 600;
}

/* Subscription Plans Grid */
.subscription-plans {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.plan-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 30px 20px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.plan-card.popular {
    border-color: var(--primary-color);
    border-width: 3px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.plan-header {
    text-align: center;
    margin-bottom: 20px;
}

.plan-title {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.plan-duration {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.plan-price {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 12px;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-currency {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-right: 5px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    flex-grow: 1;
}

.plan-features li {
    padding: 10px 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.plan-features li:last-child {
    border-bottom: none;
}

.btn-plan {
    width: 100%;
    padding: 14px;
    background: var(--bg-light);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.btn-plan:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-plan-popular {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
}

.btn-plan-popular:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

@media (max-width: 768px) {
    .subscription-plans {
        grid-template-columns: 1fr;
    }

    .subscribe-title {
        font-size: 1.5rem;
    }

    .domain-name-large {
        font-size: 1.2rem;
    }

    .back-link {
        position: static;
        display: block;
        margin-bottom: 20px;
    }
}

/* WhatsApp Modal Styles */
.whatsapp-modal-content {
    text-align: center;
    max-width: 400px;
    padding: 30px;
    overflow: hidden;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.whatsapp-modal-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
}

.whatsapp-modal-description {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
}

.qr-modal-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.qr-modal-image {
    width: auto;
    max-width: 250px;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #25D366;
    color: white;
    padding: 16px 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    width: 100%;
}

.btn-whatsapp:hover {
    background: #1ebe5d;
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

.whatsapp-icon {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .whatsapp-modal-content {
        padding: 30px 20px;
    }

    .whatsapp-modal-title {
        font-size: 1.2rem;
    }

    .qr-modal-image {
        max-width: 220px;
        max-height: 220px;
    }

    .btn-whatsapp {
        font-size: 1rem;
        padding: 14px 30px;
    }
}