/* *********************************
   CSS Variables
********************************* */
:root {
    --main-bg-color: #f5f5f5;
    /* Light grey for light theme */
    --main-text-color: #333333;
    /* Dark text */
    --accent-color: #007acc;
    /* Accent color for interactive elements */
    --button-bg-color: #007acc;
    /* Primary button background */
    --button-text-color: #ffffff;
    /* Primary button text color */
    --input-bg-color: #ffffff;
    /* Input background */
    --input-border-color: #cccccc;
    /* Input border color */
    --palette-swatch-bg-color: #e8e8e8;
    --dropdown-color: #e8e8e8;
}


/* Light Theme */

.theme-light {
    --main-bg-color: #f5f5f5;
    /* Light grey background */
    --main-text-color: #333333;
    /* Dark text */
    --accent-color: #007acc;
    /* Blue accent */
    --button-bg-color: #007acc;
    --button-text-color: #ffffff;
    --input-bg-color: #ffffff;
    --input-border-color: #cccccc;
    --dropdown-color: #e8e8e8;
}


/* Dark Theme */

.theme-dark {
    --main-bg-color: #2c2c2c;
    /* Dark grey background */
    --main-text-color: #ffffff;
    /* Light text */
    --accent-color: #ffcc00;
    /* Yellow accent */
    --button-bg-color: #444444;
    --button-text-color: #ffffff;
    --input-bg-color: #333333;
    --input-border-color: #949494;
    --palette-swatch-bg-color: #444444;
    --dropdown-color: #555555;
}

/* Light theme logo */
.logo-light {
    display: flex;
    width: 90%;
    /* Adjust size as needed */
    height: auto;
}

.logo-dark {
    display: none;
    width: 90%;
    /* Adjust size as needed */
    height: auto;
}

/* Dark theme styles */
body.dark-theme .logo-light {
    display: none;
}

body.dark-theme .logo-dark {
    display: flex;
}

/* Dark theme styles */
body.dark-theme .footer-logo-light {
    display: none;
}

body.dark-theme .footer-logo-dark {
    display: flex;
}


/* *********************************
   General Styles and Resets
********************************* */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Raleway', sans-serif;
    background-color: var(--main-bg-color);
    color: var(--main-text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-weight: 500;
    /* Default weight */
}

a {
    text-decoration: none;
    color: inherit;
}

h1,
h2,
h3 {
    font-weight: 700;
    /* Bold weight for headings */
}

p,
label {
    font-weight: 500;
    /* Light weight for text */
}


main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0;
}

/* *********************************
   Header and Top Navigation
********************************* */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: var(--header-bg-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease, margin 0.3s ease;
}

#topNav {
    width: 100%;
}

.right-side {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.nav-brand {
    display: flex;
    gap: 10px;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: center;
}

.nav-brand h1 {
    font-size: 1.5em;
    margin: 0;
    color: var(--main-text-color);
}

.theme-select {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* *********************************
   Sidebar
********************************* */

/* Sidebar container */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    /* Initially hidden outside the screen */
    width: 300px;
    height: 100%;
    background-color: var(--main-bg-color);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
}

body.sidebar-open .palette-display-section,
body.sidebar-open #contrastReportButton,
body.sidebar-open .text-extractor-container,
body.sidebar-open .palette-grid {
    transition: width 0.3s ease, margin 0.3s ease;
    width: calc(100% - 300px);
}

body.sidebar.open #topNav {
    transition: width 0.3s ease, margin 0.3s ease;
    width: calc(100% - 300px);
}


body.sidebar-open .content-area-2 {
    width: calc(100% - 400px);
    margin: 100px 50px;
    transition: width 0.3s ease, margin 0.3s ease;
}

body.sidebar-open main {
    justify-content: flex-start;
}

.sidebar h3 {
    padding: 0 20px;
    font-size: 1.4em;
    font-weight: 600;
    color: var(--main-text-color);
    margin: 0;
}

/* Horizontal rule styling */
.sidebar hr {
    width: 90%;
    margin: 15px auto;
    border-color: var(--accent-color);
}

/* Navbar Tools Container */
.navTools {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
}

/* Individual Tool Styling */
.navTool {
    width: 90%;
    padding: 10px;
    background-color: var(--input-bg-color);
    border: 1px solid var(--input-border-color);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navTool p {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--secondary-text-color);
    margin-bottom: 8px;
    text-align: center;
}

/* Page Links Styling */
.pageLinks a {
    padding: 10px 20px;
    font-size: 1em;
    color: var(--main-text-color);
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    display: block;
}

.pageLinks a:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 5px;
}

body.sidebar-open .sidebar {
    right: 0;
    /* Sidebar open */
}

body .sidebar {
    right: -300px;
    /* Sidebar hidden */
}

/* Close button for sidebar */
.close-sidebar {
    align-self: flex-end;
    padding: 10px;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--main-text-color);
    cursor: pointer;
    margin: 10px;
}

.sidebar.open {
    right: 0;
    /* Slide in to be fully visible */
}

/* Sidebar toggle button */
.sidebar-toggle {
    background-color: var(--main-bg-color);
    color: var(--main-text-color);
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1em;
    transition: background-color 0.3s;
}

.sidebar-toggle:hover {
    color: var(--accent-color);
}

.title-x {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
}

/* Selector Dropdown Styling */
select.palette-selector {
    width: 100%;
    padding: 8px;
    font-size: 1em;
    color: var(--main-text-color);
    background-color: var(--input-bg-color);
    border: 1px solid var(--input-border-color);
    border-radius: 5px;
    cursor: pointer;
}

.harmony-description {
    margin-top: 5px;
    font-size: 0.85em;
    color: #555;
    padding: 5px;
    background-color: #f3f3f3;
    border-radius: 5px;
    text-align: center;
}

.sidebar h3 {
    padding: 0 20px;
    font-size: 1.4em;
    font-weight: 600;
    color: var(--main-text-color);
}

/* Generate Button */
.generate-button {
    width: 90%;
    padding: 10px;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

/* Login Button */
#loginButton {
    position: absolute;
    bottom: 20px;
    width: 90%;
    padding: 10px;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border-radius: 5px;
    font-size: 1em;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}


/* *********************************
   Export Options
********************************* */
.navTool .export-options {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#export-format {
    width: 100%;
    margin: 10px 0px;
}

select#export-format {
    padding: 10px;
    background-color: var(--input-bg-color);
    color: var(--input-text-color);
    border: 1px solid var(--input-border-color);
    border-radius: 5px;
}

#export-button {
    width: 100%;
}

/* *********************************
   Button Styles
********************************* */


/* Navbar Upload Button */
.btn {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--button-text-color);
    background-color: var(--button-bg-color);
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
    font-weight: 500;
    user-select: none;
    justify-content: center;
    border: none;
}

.btn:hover {
    opacity: 0.8;
}

/* *********************************
   Footer Styles
********************************* */

/* Footer Styles */
#footer {
    background-color: var(--dropdown-color);
    color: var(--main-text-color);
    padding: 40px 20px;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--main-text-color);
}

.footer-section {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    margin: 10px;
    width: 30%;
}

.footer-logo-light {
    display: flex;
    width: 150px;
    margin-bottom: 20px;
}

.footer-logo-dark {
    display: none;
    width: 150px;
    margin-bottom: 20px;
}

#footer h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--accent-color);
}

#footer p {
    font-size: 0.9em;
    line-height: 1.5;
}

#footer ul {
    list-style: none;
    padding: 0;
}

#footer ul li {
    margin-bottom: 8px;
}

#footer ul li a {
    color: var(--main-text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

#footer ul li a:hover {
    color: var(--accent-color);
}

.social-icons a {
    color: var(--main-text-color);
    font-size: 1.5em;
    margin: 0 8px;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    padding-top: 20px;
    font-size: 0.85em;
    color: var(--main-text-color);
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    flex-direction: column;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
    }

    .footer-section {
        text-align: center;
        width: 90%;
    }
}


/* *********************************
   Responsive Styles
********************************* */
@media (max-width: 768px) {

    /* Top Navigation */
    .top-nav {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 15px;
    }

    .sidebar {
        font-size: 1.5em;
    }

    .nav-brand h1 {
        font-size: 1.2em;
    }

    /* Navbar with Stacked Layout */
    .navbar {
        flex-direction: column;
        padding: 10px 15px;
    }

    .navbar ul {
        flex-direction: row;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    /* Sidebar */
    .sidebar {
        width: 100%;
        right: -100%;
    }

    .sidebar.open {
        right: 0;
    }

    /* Container Adjustment */
    .container {
        flex-direction: column;
        gap: 15px;
    }

    .image-preview {
        width: 100%;
    }

    /* Color Inputs */
    .color-inputs {
        flex-direction: column;
        gap: 10px;
    }

    /* Dropdown Menu */
    .dropdown {
        width: 90%;
        margin-top: 10px;
        z-index: 20;
        right: -69px;
    }

    /* Palette Display */
    .palette-display {
        grid-template-columns: 1fr;
    }


    #paletteDisplay .palette-display {
        height: 100vh;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-height: 85%;
        padding: 15px;
    }

    /* Harmony Description */
    .harmony-description {
        font-size: 0.85em;
        padding: 8px;
    }

    #counter-container {
        margin: 0;
    }
}

@media (max-width: 576px) {

    /* Top Navigation Adjustments */
    .top-nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .site-logo {
        width: 30px;
    }

    .navbar {
        padding: 8px 15px;
    }

    /* Container Adjustment */
    .container {
        flex-direction: column;
        gap: 10px;
    }

    /* Navbar */
    .navbar ul {
        gap: 5px;
    }

    /* Color Picker */
    .color-picker input[type="color"] {
        width: 35px;
        height: 35px;
    }

    .color-input-group input[type="text"] {
        width: 80px;
        font-size: 0.9em;
    }

    /* Sidebar and Toggle Adjustments */
    .sidebar-content a {
        padding: 15px 20px;
        font-size: 0.95em;
    }

    .sidebar-toggle {
        font-size: 0.9em;
        padding: 8px;
    }

    /* Harmony Description */
    .harmony-description {
        font-size: 0.8em;
        padding: 6px;
    }

    /* Palette Swatch Text */
    .color-swatch .color-code {
        font-size: 0.7em;
        padding: 1px 4px;
    }

    /* Modal Close */
    .modal-content {
        padding: 15px;
    }
}