/* Authentication Pages Styles */

/* Auth Container */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
    background: transparent;
    border-radius: 24px;
}

/* Auth Card */
.auth-card {
    background: var(--component-bg);
    border-radius: 24px;
    padding: 3rem 4rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #2dd4bf, var(--primary));
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 8px rgba(24, 66, 67, 0.2));
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* Toggle Buttons */
.auth-toggle {
    display: flex;
    background: var(--bg);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 2rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.auth-toggle-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.auth-toggle-btn.active {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.auth-toggle-btn:hover:not(.active) {
    background: var(--hover-bg);
    color: var(--text);
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

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

.input-wrapper svg {
    position: absolute;
    right: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 3rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-wrapper input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(24, 66, 67, 0.1);
}

.input-wrapper input.error {
    border-color: var(--error, #ef4444);
}

.input-wrapper input.success {
    border-color: var(--success, #10b981);
}

.password-toggle {
    position: absolute;
    left: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text);
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 33%;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-fill.weak {
    width: 33%;
    background: #ef4444;
}

.strength-fill.medium {
    width: 66%;
    background: #f59e0b;
}

.strength-fill.strong {
    width: 100%;
    background: #10b981;
}

.strength-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.strength-text.weak { color: #ef4444; }
.strength-text.medium { color: #f59e0b; }
.strength-text.strong { color: #10b981; }

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.auth-submit-btn:active {
    transform: translateY(-1px);
}

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

.auth-submit-btn.loading {
    pointer-events: none;
    position: relative;
}

.auth-submit-btn.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

/* Error Message */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1rem;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

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

.auth-divider span {
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Social Login */
.social-login {
    display: flex;
    gap: 1rem;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.social-btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.social-btn:hover {
    border-color: var(--primary);
    background: var(--hover-bg);
}

.social-btn.google {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.social-btn.google:hover {
    border-color: #4285F4;
}

.social-btn.github {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.social-btn.github:hover {
    border-color: #333;
}

/* Terms */
.auth-terms {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
}

.auth-terms a {
    color: var(--primary);
    text-decoration: none;
}

.auth-terms a:hover {
    text-decoration: underline;
}

/* Features Preview */
.auth-features {
    max-width: 400px;
}

.auth-features h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text);
    background: linear-gradient(135deg, var(--primary), #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: var(--component-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.features-list li:hover {
    transform: translateX(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(24, 66, 67, 0.1);
}

.features-list li svg {
    color: #10b981;
    flex-shrink: 0;
    background: rgba(16, 185, 129, 0.1);
    padding: 8px;
    border-radius: 10px;
    width: 40px;
    height: 40px;
}

.features-list li span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

/* Profile Page Styles - Clean & Modern */
.profile-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.profile-header {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--component-bg);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.profile-info {
    text-align: center;
}

.profile-info h1 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem 0;
    color: var(--text);
    font-weight: 700;
}

.profile-info p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 1rem;
}

.logout-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Profile Sections */
.profile-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-section {
    background: var(--component-bg);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text);
}

.section-title svg {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

/* Stats Grid - Simplified */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: var(--bg);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-icon {
    display: none;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Usage Bar */
.usage-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Preferences Form - Compact */
.preferences-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.preference-item:last-of-type {
    border-bottom: none;
}

.preference-item label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.preference-item select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    min-width: 120px;
}

.preference-item select:focus {
    outline: none;
    border-color: var(--primary);
}

.save-preferences-btn {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 0.5rem;
}

.save-preferences-btn:hover {
    background: var(--primary-hover);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 0.95rem;
    color: var(--text);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.view-all-btn {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--primary);
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    margin-top: 1rem;
}

.view-all-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Export Buttons - Simplified */
.export-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.export-btn svg {
    width: 16px;
    height: 16px;
}

.export-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.export-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.export-btn.primary:hover {
    background: var(--primary-hover);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    gap: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    color: white;
    font-size: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.modal-content {
    background: var(--component-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.full-history-list {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--bg);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.history-type {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.history-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.history-input {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.history-output {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.copy-history-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.copy-history-btn:hover {
    background: var(--primary-hover);
}

.empty-state,
.error-state,
.loading-text {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
        gap: 2rem;
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-features {
        max-width: 100%;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .profile-avatar-section {
        flex-direction: column;
    }
    
    .social-login {
        flex-direction: column;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .preferences-form {
        grid-template-columns: 1fr;
    }
}

/* Default Avatar */
.profile-avatar-large[src*="default-avatar"],
.user-avatar[src*="default-avatar"] {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
}
