:root {
    --glass-bg: rgba(15, 15, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    --text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Solid Navbar */
.glass-nav {
    background: #0f0f14;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0; /* Navbar non si restringe mai */
}

.nav-link {
    font-weight: 400;
    color: rgba(255,255,255,0.7) !important;
    transition: color 0.2s;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.nav-link:hover, .nav-link.active {
    color: #fff !important;
    font-weight: 600;
}

/* Footer */
.footer {
    flex-shrink: 0; /* Footer non si restringe mai */
}

/* App Container - occupa tutto lo spazio tra navbar e footer */
.app-container {
    flex: 1;
    overflow: hidden; /* Il main non scorre da solo */
    position: relative;
}

/* Ogni view-section occupa tutta l'area del main e gestisce il suo scroll */
.view-section {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Scroll interno alla view */
}

.view-section.active {
    display: block;
}

/* Generator view needs flex for the palette columns */
#view-generator.active {
    display: flex;
    flex-direction: column;
}

#view-generator {
    position: relative;
    overflow: hidden;
}

.hint-overlay {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    z-index: 10;
    pointer-events: none;
}

.hint-overlay .badge {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

#view-predefined, #view-community {
    background-color: #E9ECEF; /* Grigio chiaro (più scuro del precedente) */
    color: #212529;
}

#view-predefined h2, #view-community h2 {
    color: #212529;
}

.palette-container {
    flex: 1;
    display: flex;
    flex-direction: row;
    width: 100%;
}

/* Mobile responsive palette (stack vertically if narrow) */
@media (max-width: 768px) {
    .palette-container {
        flex-direction: column;
    }
}

.color-col {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: flex 0.3s ease, background-color 0.4s ease;
    position: relative;
    cursor: grab;
    min-width: 0; /* Allow shrinking below content size if needed */
}

.color-col:active {
    cursor: grabbing;
}

/* Hover expansion effect for desktop */
@media (min-width: 769px) {
    .color-col:hover {
        flex: 1.2;
    }
}

.color-col.drag-over {
    opacity: 0.7;
    transform: scale(0.98);
}

.color-info {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    text-align: center;
    text-shadow: var(--text-shadow);
    background: rgba(0,0,0,0.15);
    padding: clamp(0.5rem, 1.5vw, 1.5rem);
    border-radius: 1rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.05);
    min-width: 0;
    max-width: 90%;
}

.color-col:hover .color-info {
    opacity: 1;
    transform: translateY(0);
}

.hex-value {
    font-size: clamp(1rem, 2.5vw, 2.5rem);
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.rgb-value {
    font-size: clamp(0.7rem, 1vw, 1rem);
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: clamp(0.5rem, 1vw, 1rem);
}

.color-actions .btn {
    backdrop-filter: blur(5px);
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: white;
}

.color-actions .btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

/* Tooltip for copy */
.copy-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.copy-tooltip.show {
    opacity: 1;
}

.palette-card-btn {
    background: rgba(0,0,0,0.05);
    color: #212529;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.palette-card-btn:hover {
    background: rgba(0,0,0,0.15);
}

/* Glass Modal */
.glass-modal {
    background: rgba(20, 20, 25, 0.75);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    color: white;
}

.glass-modal .form-control {
    background: rgba(0,0,0,0.3) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.1);
}
.glass-modal .form-control:focus {
    box-shadow: none;
    border-color: rgba(255,255,255,0.3);
}

/* Palette Cards */
.palette-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.palette-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.palette-card-colors {
    display: flex;
    height: 120px;
}

.palette-card-color {
    flex: 1;
    height: 100%;
}

.palette-card-info {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.palette-card-title {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.palette-card-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Color Details & Custom Color Picker */
.tracking-wide {
    letter-spacing: 0.1em;
}

.color-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-picker-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
}

.color-block-mini {
    flex: 1;
    height: 100%;
    transition: transform 0.2s;
    cursor: pointer;
}

.color-block-mini:hover {
    transform: scaleY(1.2);
    z-index: 5;
}

.comp-color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.comp-color-circle:hover {
    transform: scale(1.1);
}

/* Footer */
.footer-link {
    transition: color 0.2s ease;
}
.footer-link:hover {
    color: #ffffff !important;
}
