/*
-----------------------------------------------------------------------------
© 2026 Artalor
Artalor Project — All rights reserved.
Licensed for personal and educational use only.
Commercial use or redistribution prohibited.
See LICENSE.md for full terms.
-----------------------------------------------------------------------------
*/

/* Authentication Styles */

/* Navigation Bar */
.user-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.nav-logo i {
    color: #a855f7;
    font-size: 24px;
}

.nav-tagline {
    font-size: 22px;
    font-weight: 400;
    color: #999;
    margin-left: 12px;
    letter-spacing: 0.5px;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-primary, .btn-secondary {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.4);
}

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

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

/* User Profile */
.user-profile {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.user-info span {
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
}

.user-info i {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.user-profile:hover .user-info i {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.user-profile:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-item i {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    width: 16px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s ease;
}

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

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-modal-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
}

.auth-modal-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* Google Login Button */
.google-login-btn {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.google-login-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 16px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Error Message */
.auth-error {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.4);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.auth-footer a {
    color: #a855f7;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-footer a:hover {
    color: #9333ea;
    text-decoration: underline;
}

/* Adjust main container for navbar */
.home-page .main-container {
    margin-top: 80px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-tagline {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 12px 16px;
    }

    .nav-tagline {
        display: none;
    }

    .nav-logo {
        font-size: 18px;
    }

    .auth-modal-content {
        padding: 30px 24px;
        width: 95%;
    }
    
    .auth-modal-header h2 {
        font-size: 24px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 8px 16px;
        font-size: 13px;
    }

    .user-info {
        padding: 6px 10px;
    }

    .user-info span {
        display: none;
    }

    .api-keys-actions {
        flex-direction: column;
    }

    .api-keys-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 10px 12px;
    }

    .nav-logo {
        font-size: 16px;
        gap: 6px;
    }

    .nav-logo span {
        display: none;
    }

    .auth-buttons {
        gap: 8px;
    }

    .btn-primary, .btn-secondary {
        padding: 7px 12px;
        font-size: 12px;
    }

    .auth-modal-content {
        padding: 24px 16px;
        width: 96%;
        border-radius: 12px;
    }

    .auth-modal-header h2 {
        font-size: 22px;
    }

    .google-login-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* API Keys Modal Styles */
.api-keys-info {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

.api-keys-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.5;
}

.api-keys-info i {
    color: #a855f7;
    margin-right: 8px;
}

.api-key-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.api-key-input-wrapper input {
    width: 100%;
    padding-right: 44px;
}

.api-key-input-wrapper .toggle-visibility {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.api-key-input-wrapper .toggle-visibility:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.form-group small {
    display: block;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-top: 6px;
}

.form-group label i {
    margin-right: 8px;
    color: #a855f7;
}

.form-group label .api-link {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.form-group label .api-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.api-keys-status {
    margin: 16px 0;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.api-keys-status.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.api-keys-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.api-keys-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.api-keys-actions .btn-secondary {
    flex: 0 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-keys-actions .auth-submit-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* API Key indicator in navigation */
.api-key-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
}

.api-key-indicator.configured {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.api-key-indicator.not-configured {
    background: rgba(255, 255, 255, 0.3);
}
