/* ===================================
   Dashboard Styles
   =================================== */

.dashboard-container {
    /* Dark theme variable overrides */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --bg-secondary: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.09);
    --border-color-light: rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    background: linear-gradient(135deg, #182140 0%, #1c2d4a 60%, #182340 100%);
}

/* Sidebar */
.sidebar {
    background: #18243a;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    flex: 1;
    padding: 0.625rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    cursor: pointer;
    font-size: 0.9375rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #818cf8;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.28), rgba(118, 75, 162, 0.22));
    color: #818cf8;
    border-right: 4px solid #667eea;
    font-weight: 600;
}

.nav-item i {
    font-size: 1.125rem;
}

.sidebar-footer {
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
}

/* Main Content */
.dashboard-main {
    padding: 0.75rem;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 24px rgba(102, 126, 234, 0.45), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.header-left h1 {
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.header-left p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.credits-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: var(--shadow-colored);
    font-size: 0.875rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-colored);
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-title {
    margin-bottom: 1rem;
}

.section-title h2 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.section-title p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Reset text vars inside pricing cards so dark-theme overrides
   don't produce white-text-on-white-card on profile.html */
.dashboard-container .pricing-card {
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    color: #1a202c;
}

.dashboard-container .pricing-card .section-title p,
.dashboard-container .pricing-card .pricing-header p,
.dashboard-container .pricing-card .pricing-price .per-credit {
    color: #2d3748;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: #253550;
    padding: 0.875rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.125rem;
}

.stat-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.dashboard-card {
    background: #3e5070;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}

.dashboard-card:hover {
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.22);
}

.card-header {
    padding: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    margin: 0;
    font-size: 1.0625rem;
}

.card-content {
    padding: 0.875rem;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.action-btn:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateX(8px);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(240, 147, 251, 0.05));
}

.action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.action-btn h4 {
    margin-bottom: 0.125rem;
    font-size: 0.9375rem;
}

.action-btn p {
    margin: 0;
    font-size: 0.8125rem;
}

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

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.activity-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-colored);
    font-size: 0.875rem;
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    margin-bottom: 0.125rem;
    font-size: 0.9375rem;
}

.activity-content p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

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

/* Downloads */
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.download-card {
    background: #253550;
    padding: 1rem 0.875rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.download-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.875rem;
    margin: 0 auto 0.75rem;
    box-shadow: var(--shadow-colored);
}

.download-card h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.download-card .version {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.installation-steps {
    padding-left: 1.125rem;
}

.installation-steps li {
    margin-bottom: 0.625rem;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.9375rem;
}

/* Settings Form */
.settings-form {
    max-width: 500px;
}

.settings-form .form-group {
    margin-bottom: 1rem;
}

.settings-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
}

.settings-form input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.12);
    font-size: 0.9375rem;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.07);
    color: #e2e8f0;
}

.settings-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: #1f3050;
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.0625rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: 0.875rem;
}

/* Payment Summary */
.payment-summary {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.25rem;
}

.payment-summary h3 {
    margin-bottom: 0.625rem;
    font-size: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.summary-item.total {
    border-top: 2px solid var(--border-color);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
}

/* Payment Methods */
.payment-methods h3 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.payment-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 0.75rem;
}

.payment-btn:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.payment-btn i {
    font-size: 1.5rem;
}

.payment-btn.stripe {
    color: #635bff;
}

.payment-btn.paypal {
    color: #0070ba;
}

/* Alert Messages */
.alert-success,
.alert-error {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #059669;
}

.alert-success i {
    color: #10b981;
    font-size: 1.25rem;
}

.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.alert-error i {
    color: #ef4444;
    font-size: 1.25rem;
}

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

/* Password Input Wrapper with Eye Icon */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

.toggle-password i {
    font-size: 1rem;
}

/* Password Requirements */
.password-requirements {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.password-requirements small {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-requirements li i {
    font-size: 0.5rem;
    color: var(--text-light);
}

.password-requirements li.valid {
    color: #10b981;
}

.password-requirements li.valid i {
    color: #10b981;
}

.password-requirements li.invalid {
    color: #ef4444;
}

.password-requirements li.invalid i {
    color: #ef4444;
}

/* Password Strength Meter */
.password-strength {
    margin-top: 0.75rem;
}

.strength-label {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.strength-label span {
    font-weight: 600;
}

.strength-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.strength-fill.weak {
    width: 33%;
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.strength-fill.medium {
    width: 66%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.strength-fill.strong {
    width: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
}

#strengthText.weak {
    color: #ef4444;
}

#strengthText.medium {
    color: #f59e0b;
}

#strengthText.strong {
    color: #10b981;
}

/* Password Match Indicator */
#passwordMatch {
    display: block;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

#passwordMatch.match {
    color: #10b981;
}

#passwordMatch.no-match {
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 992px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        transition: var(--transition);
        z-index: 1000;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-right {
        flex-direction: column;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

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