* {
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    min-height: 100vh;
    padding: 20px 0;
    margin: 0;
}

.container-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header h1 {
    font-weight: 700;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.95;
}

/* Card Styles */
.generator-card,
.saved-card {
    background: white;
    border-radius: 15px;
    padding: 35px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    margin-bottom: 30px;
    animation: fadeIn 0.8s ease-out;
}

.generator-card h2,
.saved-card h2 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 1.8em;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: #ecfdf5;
    border-radius: 10px;
    border: 1px solid #a7f3d0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.control-group input[type="color"] {
    width: 100%;
    height: 45px;
    border: 2px solid #d1fae5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group input[type="color"]:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #10b981, #059669);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #10b981;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    width: 24px;
    height: 24px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #10b981;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    width: 24px;
    height: 24px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

#color-count-value {
    font-weight: 700;
    color: #10b981;
    margin-top: 5px;
    font-size: 1.1em;
}

.styled-input {
    padding: 12px 15px;
    border: 2px solid #d1fae5;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.styled-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn-primary-gradient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    padding: 14px 35px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 25px;
    font-size: 1em;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary-gradient:hover {
    background: linear-gradient(135deg, #10b981 50%, #059669 50%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-primary-gradient:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    border: 2px solid #10b981;
    color: #10b981;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.btn-secondary:hover {
    background: #10b981;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Palette Preview */
.color-palette {
    display: flex;
    margin-bottom: 25px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
    height: 140px;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.color-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.85em;
}

.color-box:hover {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.color-box:active {
    transform: scale(1.04);
}

/* Color Actions */
.color-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.color-actions .styled-input {
    flex: 1;
    min-width: 200px;
}

.color-actions .btn-secondary {
    white-space: nowrap;
}

/* Saved Palettes */
.saved-palettes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.saved-palette {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease-out;
}

.saved-palette:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.25);
}

.saved-color {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    font-weight: 600;
}

.palette-name {
    padding: 12px;
    text-align: center;
    background: #ecfdf5;
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.95em;
    border-top: 2px solid #a7f3d0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.tooltip {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    z-index: 1000;
    pointer-events: none;
    transform: translateX(-50%);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Navigation */
.navigation-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    gap: 20px;
    flex-wrap: wrap;
}

.back-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

footer p {
    margin: 0;
    font-size: 0.95em;
    opacity: 0.9;
}

footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

footer a:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }

    .header p {
        font-size: 1em;
    }

    .generator-card,
    .saved-card {
        padding: 20px;
    }

    .controls {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .saved-palettes {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .color-palette {
        height: 120px;
    }

    .color-actions {
        flex-direction: column;
    }

    .color-actions .styled-input {
        min-width: unset;
    }

    .navigation-links {
        flex-direction: column;
        margin-top: 30px;
    }

    .back-link {
        width: 100%;
        text-align: center;
    }
}

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

    .generator-card,
    .saved-card {
        padding: 15px;
        border-radius: 10px;
    }

    .controls {
        padding: 12px;
    }

    .btn-primary-gradient {
        width: 100%;
    }

    .saved-palettes {
        grid-template-columns: 1fr;
    }
}