/* CSS Variables for Theme System */
:root {
    /* Default theme: Midnight Bloom */
    --main-card-title-color: #1b1430;
    --main-card-inner-bg: #d1c9ff;
    --main-card-outer-bg: #171128;
    --pagination-inactive-color: #ffffff;
    --pagination-active-border-color: #9a78ff;
    --pagination-active-text-color: #ffffff;
    --button-group-bg: #4f3a8c;
    --scheme-glow-color: #795ec9;

    --primary: #9d85ff;
    --primary-dark: #7a56d2;
    --primary-light: #d6c6ff;
    --secondary: #f8f8f8;
    --text: #ffffff;
    --text-dark: #333333;
    --background: #0a0a1a;
    --background-light: #1a1a3a;
    --border: #1e1e3a;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --grid-line: #1e1e3a;
    --modal-bg: #ffffff;
}

/* Theme: Midnight Bloom (Default) */
[data-theme="midnight-bloom"] {
    --main-card-title-color: #1b1430;
    --main-card-inner-bg: #d1c9ff;
    --main-card-outer-bg: #171128;
    --pagination-inactive-color: #ffffff;
    --pagination-active-border-color: #9a78ff;
    --pagination-active-text-color: #ffffff;
    --button-group-bg: #4f3a8c;
    --scheme-glow-color: #795ec9;
    --text: #ffffff;
    --text-dark: #333333;
    --background: #0a0a1a;
    --background-image-desktop: url('../assets/background/desktop/Midnight Bloom.svg');
    --background-image-mobile: url('../assets/background/mobile/Midnight Bloom.svg');
    --logo-image: url('../logo/Midnight Bloom.svg');
}

[data-theme="midnight-bloom"] .sidebar-item.active,
[data-theme="midnight-bloom"] .social-icon {
    background-color: #4000FF;
}

[data-theme="midnight-bloom"] .version-text {
    color: #4000FF;
}

[data-theme="midnight-bloom"] .social-icon:hover {
    background-color: #3000cc; /* A slightly darker shade of #4000FF */
}

/* Theme: Cyber Lagoon */
[data-theme="cyber-lagoon"] {
    --main-card-title-color: #103634;
    --main-card-inner-bg: #66fcf0;
    --main-card-outer-bg: #103634;
    --pagination-inactive-color: #ffffff;
    --pagination-active-border-color: #ffae00;
    --pagination-active-text-color: #ffffff;
    --button-group-bg: #185e5b;
    --scheme-glow-color: #46a29e;
    --text: #ffffff;
    --text-dark: #103634;
    --background: #0a1a1a;
    --background-image-desktop: url('../assets/background/desktop/Cyber Lagoon.svg');
    --background-image-mobile: url('../assets/background/mobile/Cyber Lagoon.svg');
    --logo-image: url('../logo/Cyber Lagoon.svg');
}

/* Theme: VSCode */
[data-theme="vscode"] {
    --main-card-title-color: #ffffff;
    --main-card-inner-bg: #1e1e1e;
    --main-card-outer-bg: #333333;
    --pagination-inactive-color: #ffffff;
    --pagination-active-border-color: #3793ff;
    --pagination-active-text-color: #ffffff;
    --button-group-bg: #3793ff;
    --scheme-glow-color: #3793ff;
    --text: #ffffff;
    --text-dark: #ffffff;
    --background: #0a0a1a;
    --background-image-desktop: url('../assets/background/desktop/VSCode.svg');
    --background-image-mobile: url('../assets/background/mobile/VSCode.svg');
    --logo-image: url('../logo/VSCode.svg');
}

/* Theme: Rose Fog */
[data-theme="rose-fog"] {
    --main-card-title-color: #000000;
    --main-card-inner-bg: #dec7c4;
    --main-card-outer-bg: #ffffff;
    --pagination-inactive-color: #000000;
    --pagination-active-border-color: #B49995;
    --pagination-active-text-color: #000000;
    --button-group-bg: #ffffff;
    --scheme-glow-color: #eed9d3;
    --text: #000000;
    --text-dark: #000000;
    --background: #f7f0f0;
    --modal-bg: #faf8f8;
    --background-image-desktop: url('../assets/background/desktop/Rose Fog.svg');
    --background-image-mobile: url('../assets/background/mobile/Rose Fog.svg');
    --logo-image: url('../logo/Rose Fog.svg');
}
/* Font Definitions */
@font-face {
    font-family: 'Exo';
    src: url('../assets/fonts/Exo/exo2_0_regular.otf') format('opentype');
    font-weight: normal;
}

@font-face {
    font-family: 'Exo';
    src: url('../assets/fonts/Exo/exo2_0_bold.otf') format('opentype');
    font-weight: bold;
}

@font-face {
    font-family: 'IBM Plex';
    src: url('../assets/fonts/IBM Plex/IBMPlexSans-Regular.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'IBM Plex';
    src: url('../assets/fonts/IBM Plex/IBMPlexSans-Bold.ttf') format('truetype');
    font-weight: bold;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'IBM Plex', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-image: var(--background-image-mobile);
    background-size: cover;
    background-position: center;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

@media (min-width: 769px) {
    body {
        background-image: var(--background-image-desktop);
    }
}

/* Blur effect for modal backdrop */
body.modal-open {
    overflow: hidden;
}

body.modal-open .container,
body.modal-open .grid-pattern {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

/* Container and Layout */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding: 3rem 10px;
    padding-bottom: 5px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    z-index: 2;
}

.header h1 {
    font-family: 'Exo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text);
}

.header p {
    color: #7a7a7a;
    font-size: 0.9rem;
}

/* Main Card */
.main-card-outer {
    width: 72%;
    max-width: 900px;
    background: var(--main-card-outer-bg);
    border-radius: 25px;
    padding-bottom: 1rem;
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.main-card-inner {
    background: var(--main-card-inner-bg);
    border-radius: 25px;
    padding: 2rem;
    padding-top:1.5rem;
    margin-bottom: 1rem;
}

.main-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--main-card-title-color);
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 1rem;
}

.btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background-color: var(--button-group-bg);
    color: white;
}

.btn:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.btn i {
    font-size: 16px;
}

/* Content Area */
.content-area {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.no-sites {
    color: #ccc;
    font-size: 1rem;
    margin-top: 1rem;
    text-align: center;
}

.content-highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Site Grid */
.site-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 1.5rem;
}

.site-card {
    background: var(--secondary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.site-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.site-preview-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.site-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.site-card:hover .site-preview {
    transform: scale(1.05);
}

.no-preview {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #777;
    font-size: 0.9rem;
}

.site-info {
    padding: 1rem;
}

.site-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #000000;
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.page-btn {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: 2px solid var(--pagination-inactive-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    color: var(--pagination-inactive-color);
    transition: all 0.2s ease;
    font-size: 14px;
}

.page-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--pagination-active-border-color);
    transform: scale(1.05);
}

.page-btn.active {
    border-color: var(--pagination-active-border-color);
    color: var(--pagination-active-text-color);
}

[data-theme="rose-fog"] .page-btn.active {
    color: var(--pagination-active-text-color);
    border-color: var(--pagination-active-border-color);
}

[data-theme="rose-fog"] .page-btn {
    color: var(--pagination-inactive-color);
    border-color: var(--pagination-inactive-color);
}

[data-theme="rose-fog"] .btn img {
    filter: brightness(0);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 5rem;
    color: #7a7a7a;
    font-size: 0.8rem;
    z-index: 2;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 4vh;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--modal-bg);
    border-radius: 20px;
    width: 90%;
    max-width: 850px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 101;
    color: var(--text-dark);
    --text-dark: #000000;
}

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

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-body {
    display: flex;
    height: 430px;
}

.modal-sidebar {
    width: 200px;
    border-right: 1px solid #ddd;
    padding: 0;
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-dark);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-item[data-tab="about"] {
    margin-top: auto;
    border-top: 1px solid #ddd;
}

.sidebar-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sidebar-item.active {
    background-color: var(--pagination-active-border-color);
    color: white;
    font-weight: 600;
}

.modal-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

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

/* Settings Form Styles */
.settings-form {
    margin-top: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="text"] {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: var(--text-dark);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(157, 133, 255, 0.2);
}

.folder-icon {
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.folder-icon:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-container label {
    cursor: pointer;
    color: var(--text-dark);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-value {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
    min-width: 40px;
}

/* Color Schemes */
.color-schemes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.color-scheme {
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-scheme .color-palette {
    border-radius: 20px;
    box-shadow: 0 0 0 2px transparent;
    transition: all 0.2s ease;
}

.color-scheme.selected .color-palette {
    box-shadow: 0 0 15px 3px var(--scheme-glow-color);
}

.color-palette {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    height: 100px;
    width: 270px; /* 3 * 90px */
}

.color-swatch {
    width: 90px;
    height: 100%;
}

.color-name {
    font-size: 0.9rem;
    color: #000000;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* About Section */
.about-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-version {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
}

.version-text {
    color: var(--pagination-active-border-color);
}

.logo-dynamic {
    width: 40px;
    height: 40px;
    background-image: var(--logo-image);
    background-size: contain;
    background-repeat: no-repeat;
}

.about-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.about-devs {
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.logo {
    width: 40px;
    height: 40px;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pagination-active-border-color);
    border-radius: 7px;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.license {
    font-size: 0.85rem;
    color: #888;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Grid Pattern Background */
.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Refresh Modal (Legacy) */
.refresh-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content-refresh {
    background-color: var(--modal-bg);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--card-shadow);
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 1.1rem;
    color: #000000;
    margin-bottom: 20px;
}

.result-text {
    font-size: 1rem;
    color: #000000;
    font-weight: bold;
}

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

    .header {
        margin-bottom: 2rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .main-card-outer {
        width: 95%;
    }
    
    .main-card-inner {
        padding: 1.5rem;
        padding-bottom: 2.5rem;
    }
    
    .site-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal {
        width: 90%;
        max-height: 90vh;
    }
    
    .modal-body {
        flex-direction: column;
        height: auto;
    }
    
    .modal-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .sidebar-item {
        white-space: nowrap;
        border-bottom: none;
        border-right: 1px solid rgba(0, 0, 0, 0.05);
    }

    .sidebar-item[data-tab="about"] {
        margin-top: 0;
        border-top: none;
    }
    
    .modal-content {
        padding: 2.5rem;
    }
    
    .main-card-header {
        flex-direction: column-reverse;
        gap: 1rem;
        align-items: center;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .color-schemes {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .color-schemes::-webkit-scrollbar { 
        display: none;  /* Safari and Chrome */
    }

    .footer {
        margin-top: 2rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .btn {
        width: 45px;
        height: 45px;
    }

    .main-card-header {
        gap: 1.5rem;
    }
    
    .main-card-inner {
        padding: 1rem;
        padding-bottom: 2rem;
        padding-top: 1.5rem;
    }
    
    .site-grid {
        gap: 1.5rem;
    }
    
    .color-schemes {
        gap: 0.5rem;
    }

    .color-palette {
        height:70px;
        width: 100%;
    }

    .color-scheme .color-palette {
        border-radius: 15px;
    }

    .color-swatch {
        width: 33.33%;
    }
}
