/* CSS Variables for Theme Switching */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #213547;
    --text-secondary: #666;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --accent-color: #646cff;
    --accent-hover: #747bff;
    --success-color: #27ae60;
    --success-border: rgba(46, 204, 113, 0.3);
    --warning-color: #b7950b;
    --warning-border: rgba(241, 196, 15, 0.6);
    --danger-color: #c0392b;
    --danger-border: rgba(192, 57, 43, 0.6);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --text-primary: rgba(255, 255, 255, 0.87);
    --text-secondary: #aaa;
    --card-bg: #2a2a2a;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --accent-color: #535bf2;
    --accent-hover: #646cff;
    --success-color: #2ecc71;
    --success-border: rgba(46, 204, 113, 0.4);
    --warning-color: #f7dc6f;
    --warning-border: rgba(241, 196, 15, 0.75);
    --danger-color: #e74c3c;
    --danger-border: rgba(231, 76, 60, 0.7);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--accent-color), #af47ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.theme-toggle {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--accent-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: var(--card-shadow);
    font-size: 1rem;
}

.theme-toggle:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

/* Category Sections */
.category-section {
    margin-bottom: 3rem;
    text-align: center;
}

.category-header {
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent-color);
}

.category-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.category-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Flexbox Grid Layout */
.folders-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.folder-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    flex: 1 1 300px;
    max-width: 350px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(100, 108, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.folder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.folder-icon, .card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    font-size: 2.5rem;
}

.folder-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    text-align: center;
}

.folder-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.5;
}

.folder-link {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: auto;
    border: 2px solid transparent;
    width: 100%;
    max-width: 250px;
}

.folder-link:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 108, 255, 0.3);
}

/* Badge Styles - Bordered Box Design */
.free-access-badge,
.secure-badge,
.conditional-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
    text-align: center;
    width: 100%;
    max-width: 250px;
    border: 2px solid;
    background: transparent;
    transition: all 0.3s ease;
}

/* Individual Badge Colors */
.free-access-badge {
    color: var(--success-color);
    border-color: var(--success-border);
    background: rgba(46, 204, 113, 0.1);
}

[data-theme="dark"] .free-access-badge {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.4);
}

.secure-badge {
    color: var(--danger-color);
    border-color: var(--danger-border);
    background: rgba(243, 156, 18, 0.15);
}

[data-theme="dark"] .secure-badge {
    background: rgba(243, 156, 18, 0.25);
    border-color: rgba(231, 76, 60, 0.7);
    color: #e74c3c;
}

.conditional-badge {
    color: var(--warning-color);
    border-color: var(--warning-border);
    background: rgba(241, 196, 15, 0.18);
}

[data-theme="dark"] .conditional-badge {
    background: rgba(241, 196, 15, 0.28);
    border-color: rgba(241, 196, 15, 0.75);
    color: #f7dc6f;
}

/* Add subtle hover effect to badges */
.free-access-badge:hover,
.secure-badge:hover,
.conditional-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Timer Button Container */
.timer-button-container {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(100, 108, 255, 0.1);
}

.timer-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--accent-color);
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    font-size: 1.1rem;
    min-width: 200px;
    width: auto;
}

.timer-button:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.timer-button span:first-child {
    font-size: 1.3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin-bottom: 2rem;
    }

    h1 {
        font-size: 2rem;
        text-align: center;
    }

    .theme-toggle {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .category-header h2 {
        font-size: 1.6rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .category-header h2 i {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .category-description {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .folders-grid {
        gap: 1.5rem;
    }

    .folder-card {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 1.5rem;
        text-align: center;
    }

    .folder-card h3,
    .folder-card p {
        text-align: center;
    }

    .folder-icon, .card-icon {
        font-size: 2.5rem;
        height: 60px;
    }

    .card-icon i {
        font-size: 2rem;
    }

    /* Ensure badges are visible and properly styled on mobile */
    .free-access-badge,
    .secure-badge,
    .conditional-badge {
        display: inline-block !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
        width: 100% !important;
        max-width: 250px !important;
        margin: 1rem auto 0 !important;
        border: 2px solid !important;
        background: transparent !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .folder-link {
        width: 100%;
        max-width: 250px;
        margin: 0.5rem auto;
    }

    .timer-button {
        width: 100%;
        max-width: 300px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-width: auto;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 2px solid var(--accent-color) !important;
        box-shadow: var(--card-shadow) !important;
        background: var(--card-bg) !important;
        color: var(--text-primary) !important;
    }

    .timer-button span:first-child {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .theme-toggle {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .category-header h2 {
        font-size: 1.4rem;
    }

    .category-description {
        font-size: 0.95rem;
    }

    .folder-card {
        padding: 1.25rem;
    }

    .folder-card h3 {
        font-size: 1.3rem;
    }

    .folder-card p {
        font-size: 0.95rem;
    }

    /* Ensure badges are visible on very small screens */
    .free-access-badge,
    .secure-badge,
    .conditional-badge {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8rem !important;
        max-width: 220px !important;
    }

    .timer-button {
        padding: 0.9rem 1.25rem;
        font-size: 0.95rem;
        gap: 0.5rem;
        max-width: 280px;
    }

    .timer-button-container {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
}

/* Force visibility for all badges */
.free-access-badge,
.secure-badge,
.conditional-badge {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
