@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

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

:root {
    --bg-gradient-light: linear-gradient(-45deg, #e0eafc, #cfdef3, #e8ecf1, #f5f7fa);
    --bg-gradient-dark: linear-gradient(-45deg, #0f2027, #203a43, #2c5364);
    --text-light: #2c3e50;
    --text-dark: #ecf0f1;

    --glass-bg-light: rgba(255, 255, 255, 0.7);
    --glass-bg-dark: rgba(0, 0, 0, 0.4);

    --glass-border-light: rgba(255, 255, 255, 0.5);
    --glass-border-dark: rgba(255, 255, 255, 0.1);

    --panel-bg-light: rgba(255, 255, 255, 0.45);
    --panel-bg-dark: rgba(255, 255, 255, 0.05);

    /* Default to Light Mode Variables */
    --current-bg: var(--bg-gradient-light);
    --current-text: var(--text-light);
    --current-glass-bg: var(--glass-bg-light);
    --current-glass-border: var(--glass-border-light);
    --current-panel-bg: var(--panel-bg-light);
}

body.dark-mode {
    --current-bg: var(--bg-gradient-dark);
    --current-text: var(--text-dark);
    --current-glass-bg: var(--glass-bg-dark);
    --current-glass-border: var(--glass-border-dark);
    --current-panel-bg: var(--panel-bg-dark);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -.02em;
    /* Animated Mesh Background */
    background: var(--current-bg);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    padding-bottom: 50px;
    padding-top: 100px;
    /* Space for fixed header */
    color: var(--current-text);
    transition: color 0.3s ease, background 0.3s ease;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Fixed Glassmorphism Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    z-index: 1000;

    display: flex;
    align-items: center;

    /* Glass Effect */
    /* Premium Glass Effect */
    background: var(--current-glass-bg);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--current-glass-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.theme-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--current-text);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.theme-btn:hover {
    transform: rotate(20deg);
    background: rgba(255, 255, 255, 0.1);
}

.main-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--current-text);
    margin: 0;
    letter-spacing: -0.02em;
}

/* Glassmorphism Main Container */
.main-colors-box {
    width: 100%;
    max-width: 1500px;
    /* Limit width on large screens */
    height: auto;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 3rem;

    /* Reduced Glass Effect */
    /* Sophisticated Glass Effect */
    background: var(--current-panel-bg);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--current-glass-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.hex-boxes {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    /* Allow wrapping on mobile */
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    height: auto;
}

.hex-box1,
.hex-box2,
.hex-box3,
.hex-box4,
.hex-box5 {
    padding: 1rem;
    background-color: #e1e1e1;
    /* Will be overridden by JS */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;

    flex: 1;
    /* Fill container */
    min-width: 0;
    /* Prevent overflow */
    height: 420px;
    /* Taller height */
    border-radius: 24px;
    /* Rounded corners */

    /* Reduced Shadow */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.hex-box1:hover,
.hex-box2:hover,
.hex-box3:hover,
.hex-box4:hover,
.hex-box5:hover {
    transform: translateY(-2px);
    /* Reduced lift */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .main-colors-box {
        width: 100%;
        padding: 1rem;
        gap: 1.5rem;
    }

    .hex-boxes {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .hex-box1,
    .hex-box2,
    .hex-box3,
    .hex-box4,
    .hex-box5 {
        width: 100%;
        height: 120px;
        /* taller strips on mobile */
        flex: none;
        /* Disable flex growth to allow fixed height */
        flex-direction: row;
        justify-content: space-between;
        padding: 0 2rem;
    }
}

.hex-boxes h3 {
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 1.1rem;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    /* Reduced scale */
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

#toast {
    visibility: hidden;
    min-width: 280px;
    margin-left: -140px;
    /* Center adjustment */

    /* Glassy Toast */
    background: rgba(0, 0, 0, 0.85);
    /* Darker for better contrast */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 16px 24px;
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 30px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    /* Bouncy transition */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 60px;
}

.generate-btn {
    padding: 1.2rem 3rem;

    /* Modern Gradient Button */
    background-image: linear-gradient(to right, #0c283b 0%, #658186 51%, #022136 100%);
    background-size: 200% auto;
    color: white;

    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;

    /* Glow Shadow */
    box-shadow: 0 4px 15px rgba(2, 33, 54, 0.25);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.generate-btn:hover {
    background-position: right center;
    /* change the direction of the change here */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.generate-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}