/* ==========================================================================
   Dashboard Styles (Profile, Settings, My Downloads)
   ========================================================================== */
/* Note: Base variables are in common.css */

/* Page Background */
body {
    background-color: var(--bg-body-wheat);
}

/* ==========================================================================
   Shared Containers
   ========================================================================== */
.profile-container,
.settings-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.downloads-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ==========================================================================
   Page Headers
   ========================================================================== */
.settings-header,
.downloads-header {
    margin-bottom: 30px;
}

.settings-header h1,
.downloads-header h1 {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
    transition: color var(--transition-normal);
}

.settings-header p,
.downloads-header p {
    color: var(--text-muted);
    margin: 0;
    transition: color var(--transition-normal);
}

[data-bs-theme="dark"] .settings-header h1,
[data-bs-theme="dark"] .downloads-header h1 {
    color: var(--text-main);
}

[data-bs-theme="dark"] .settings-header p,
[data-bs-theme="dark"] .downloads-header p {
    color: var(--text-muted);
}

/* ==========================================================================
   Glass Panel Sections
   ========================================================================== */
.section,
.settings-section {
    background: var(--glass-bg-light);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    color: white;
    transition: all var(--transition-normal);
    border: none;
}

[data-bs-theme="dark"] .section,
[data-bs-theme="dark"] .settings-section {
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
}

/* Section Title */
.section-title {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 22px;
}

/* ==========================================================================
   Buttons (Glass Style)
   ========================================================================== */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
}

.btn-custom {
    flex: 1;
    padding: 12px 20px;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

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

.btn-primary-custom:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    color: white;
}

.btn-primary-custom:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-secondary-custom:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

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

.form-label {
    display: block;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-label .required {
    color: var(--error-text);
}

.form-help {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 14px;
    transition: all var(--transition-normal);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.form-control:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    background: white;
}

.form-control:disabled {
    background: rgba(255, 255, 255, 0.5);
    color: #999;
    cursor: not-allowed;
}

[data-bs-theme="dark"] .form-control {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .form-control:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--secondary-color);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.4);
    transition: 0.4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* ==========================================================================
   Profile Page: Info Rows
   ========================================================================== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.info-label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.info-value {
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

[data-bs-theme="dark"] .info-value {
    color: var(--text-main);
}

/* ==========================================================================
   Profile Page: Stats Grid
   ========================================================================== */
.stats-grid-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 4px;
}

.duration-display {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

[data-bs-theme="dark"] .stat-value {
    color: var(--text-main);
}

[data-bs-theme="dark"] .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   Profile Page: Level Badge
   ========================================================================== */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.level-badge.free {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.level-badge.premium {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.level-badge.premium i {
    color: #333;
}

/* ==========================================================================
   Profile Page: Premium Sections
   ========================================================================== */
.premium-section {
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.premium-benefits {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
}

.benefit-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.benefit-icon {
    font-size: 24px;
    color: #ffd700;
    flex-shrink: 0;
}

.benefit-content strong {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
}

.benefit-content p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.btn-premium {
    display: inline-block;
    text-decoration: none;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #333;
    font-weight: bold;
    padding: 15px 40px;
    font-size: 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    color: #333;
}

.btn-premium i {
    margin-right: 8px;
}

.premium-status-section {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: 2px solid rgba(40, 167, 69, 0.5);
}

.premium-active-benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.active-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 14px;
}

.active-benefit i {
    color: #28a745;
    font-size: 18px;
    background: white;
    border-radius: 50%;
    padding: 2px;
}

/* Plan Cards */
.premium-plans-container {
    display: flex;
    gap: 30px;
    margin-top: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.plan-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    text-align: center;
    position: relative;
    transition: all var(--transition-normal);
}

.plan-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-md);
}

.plan-card.featured {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), rgba(255, 179, 71, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.5);
    transform: scale(1.05);
    z-index: 1;
}

.plan-card.featured:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 30px rgba(255, 215, 0, 0.2);
}

.plan-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.plan-price {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.plan-period {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.plan-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    min-height: 20px;
}

.btn-premium-outline {
    display: inline-block;
    width: 100%;
    text-decoration: none;
    background: transparent;
    border: 2px solid #ffd700;
    color: #ffd700;
    font-weight: bold;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-premium-outline:hover {
    background: #ffd700;
    color: #333;
}

.plan-card .btn-premium {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    box-sizing: border-box;
    display: inline-block;
}

/* Premium Dark Mode */
[data-bs-theme="dark"] .premium-section {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
    border-color: rgba(255, 215, 0, 0.4);
}

[data-bs-theme="dark"] .premium-status-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

/* ==========================================================================
   Settings Page: Danger Zone
   ========================================================================== */
.danger-zone {
    background: #fff5f5;
    border: 2px solid var(--error-border);
    color: var(--text-main);
}

.danger-zone .section-title {
    color: var(--error-text);
    border-bottom-color: rgba(231, 76, 60, 0.3);
}

.danger-zone .section-title i {
    color: var(--error-text);
}

[data-bs-theme="dark"] .danger-zone {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--error-border);
    color: var(--text-main);
}

[data-bs-theme="dark"] .danger-zone .section-title {
    color: var(--error-text);
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   My Downloads Page: File Grid
   ========================================================================== */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.file-card {
    background: linear-gradient(135deg, #718200 0%, #36bacf 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    color: white;
    position: relative;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

[data-bs-theme="dark"] .file-card {
    box-shadow: var(--shadow-md);
}

.file-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.file-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    word-break: break-word;
    color: white;
}

.file-info {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
}

.file-info div {
    margin-bottom: 5px;
}

.file-actions {
    display: flex;
    gap: 10px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--glass-bg-light);
    border-radius: var(--radius-lg);
    color: white;
    transition: all var(--transition-normal);
}

[data-bs-theme="dark"] .empty-state {
    background: var(--glass-bg-dark);
}

.empty-state i {
    font-size: 64px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

/* Video Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: auto;
}

[data-bs-theme="dark"] .modal-content {
    background: #1e1e1e;
}

.video-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-bs-theme="dark"] .video-modal .modal-header {
    border-bottom-color: #333;
}

.video-modal .modal-header h3 {
    margin: 0;
    color: #333;
}

[data-bs-theme="dark"] .video-modal .modal-header h3 {
    color: var(--text-main);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

[data-bs-theme="dark"] .close-btn:hover {
    color: #fff;
}

.video-modal .modal-body {
    padding: 20px;
}

/* Downloads Plan Card Override */
.downloads-container .plan-card {
    padding: 15px 20px;
    max-width: 280px;
}

.downloads-container .plan-title {
    display: none;
}

.downloads-container .plan-price {
    font-size: 22px;
    margin-bottom: 5px;
}

.downloads-container .plan-desc {
    font-size: 12px;
    margin-bottom: 15px;
    min-height: auto;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
    .premium-plans-container {
        flex-direction: column;
        align-items: center;
    }

    .plan-card {
        width: 100%;
        max-width: 100%;
    }

    .plan-card.featured {
        transform: none;
        margin-top: 15px;
    }

    .plan-card.featured:hover {
        transform: translateY(-5px);
    }

    .benefit-item {
        flex-direction: column;
        text-align: center;
    }
}

/* Error Message (Legacy) */
.error-message {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border-left: 4px solid var(--error-border);
}