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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.5);
    --glow: rgba(99, 102, 241, 0.4);
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text);
    direction: rtl;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 48px;
    animation: bounce 2s infinite;
}

.header h1 {
    font-size: 42px;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 0;
    margin-bottom: 30px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.card-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px 30px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.card-body {
    padding: 30px;
}

/* Auth Card */
.auth-view {
    text-align: center;
}

.auth-message {
    font-size: 18px;
    margin-bottom: 25px;
    color: var(--text);
}

.auth-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.success-icon {
    font-size: 32px;
}

.auth-success p {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.form-input {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: #fff;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
}

.form-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

.site-info {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.site-url {
    font-weight: 700;
    color: #fff;
    font-size: 18px;
}

.site-select {
    flex: 1;
    padding: 10px 15px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.site-select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
}

.site-select option {
    background: var(--dark);
    color: #fff;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-large {
    padding: 16px 40px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    font-size: 20px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px 20px;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    color: var(--text-muted);
}

/* Results */
.result-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 25px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

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

.result-value {
    font-weight: 700;
    color: #fff;
    text-align: left;
}

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

.result-link:hover {
    color: #fff;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-buttons .btn {
    flex: 1;
    min-width: 150px;
}

/* Error Card */
.error-message {
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #fff;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .header h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    .card-header h2 {
        font-size: 20px;
    }

    .card-body {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}
