/* generateur-palette.css - Styles du générateur de palette */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Barlow';
    src: url('../font/Barlow-Regular.ttf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Barlow';
    background: #fafafa;
    color: #000000;
    line-height: 1.6;
    font-size: 15px;
    font-weight: 400;
}

button, a, .color-card, .copy-btn {
    cursor: pointer;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
}

.page-header {
    background: #000000;
    color: #ffffff;
    padding: 80px 40px;
    text-align: center;
    margin: -60px -40px 60px -40px;
}

.page-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 15px;
}

.page-subtitle {
    font-size: 1.8rem;
    color: #000000;
    font-weight: 800;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.upload-section {
    background: white;
    border-radius: 12px;
    padding: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    text-align: center;
}

.upload-area {
    border: 3px dashed #e0e0e0;
    border-radius: 12px;
    padding: 60px 40px;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.upload-area.dragover {
    border-color: #ff9320;
    background: #fffef5;
}

.upload-icon {
    font-size: 4rem;
    color: #ff9320;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 10px;
}

.upload-subtext {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 25px;
}

.btn-upload {
    background: #000000;
    color: white;
    border: 2px solid #000000;
    padding: 14px 40px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.btn-upload:hover {
    background: white;
    color: #000000;
}

#imageInput {
    display: none;
}

.image-preview-section {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.image-preview-section.active {
    display: block;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.preview-title {
    background: #ff9320;
    color: #000000;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    display: inline-block;
    text-transform: lowercase;
}

.btn-change {
    background: white;
    color: #000000;
    border: 2px solid #000000;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-change:hover {
    background: #000000;
    color: white;
}

.image-preview-container {
    text-align: center;
    margin-bottom: 30px;
}

#uploadedImage {
    max-width: 100%;
    max-height: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.controls-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 25px;
    background: #fafafa;
    border-radius: 12px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-group label {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group input[type="range"] {
    width: 200px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #000000;
    cursor: pointer;
    border-radius: 50%;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #000000;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.color-count-display {
    background: #ff9320;
    color: #000;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
}

.btn-generate {
    background: #000000;
    color: white;
    border: 2px solid #000000;
    padding: 12px 35px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-generate:hover {
    background: #ff9320;
    color: #000;
    border-color: #ff9320;
}

.palette-section {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.palette-section.active {
    display: block;
}

.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.palette-title {
    background: #ff9320;
    color: #000000;
    padding: 12px 28px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 700;
    display: inline-block;
    text-transform: lowercase;
}

.export-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-export {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-export:hover {
    background: #f5f5f5;
    border-color: #000;
    color: #000;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.color-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.color-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.color-preview {
    height: 120px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.color-info {
    padding: 20px;
    background: white;
}

.color-codes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 8px;
    transition: all 0.2s;
}

.color-code-item:hover {
    background: #f0f0f0;
}

.code-label {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-value {
    font-size: 13px;
    font-weight: 600;
    color: #000;
    font-family: 'Courier New', monospace;
}

.copy-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 5px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #000;
    color: white;
}

.copy-btn.copied {
    color: #00cc88;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #000000;
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000000;
    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: 14px;
    color: #666;
    font-weight: 600;
}

.info-box {
    background: #fffef5;
    padding: 20px 25px;
    border-radius: 8px;
    margin-top: 30px;
}

.info-box h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-box p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .colors-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }
    .page-header {
        padding: 50px 20px;
        margin: -30px -20px 40px -20px;
    }
    .page-title {
        font-size: 1.8rem;
    }
    .page-subtitle {
        font-size: 1rem;
    }
    .upload-section,
    .image-preview-section,
    .palette-section {
        padding: 30px 20px;
        border-radius: 10px;
    }
    .upload-area {
        padding: 40px 20px;
    }
    .upload-icon {
        font-size: 3rem;
    }
    .upload-text {
        font-size: 1.1rem;
    }
    .btn-upload {
        padding: 12px 30px;
        font-size: 13px;
    }
    .controls-section {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    .control-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    .control-group input[type="range"] {
        width: 100%;
    }
    .btn-generate {
        width: 100%;
        padding: 14px 30px;
    }
    .colors-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }
    .color-preview {
        height: 100px;
    }
    .color-info {
        padding: 15px;
    }
    .preview-header,
    .palette-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .export-buttons {
        width: 100%;
        flex-direction: column;
    }
    .btn-export,
    .btn-change {
        width: 100%;
        justify-content: center;
    }
    #uploadedImage {
        max-height: 350px;
    }
    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }
    .page-subtitle {
        font-size: 0.95rem;
    }
    .upload-section,
    .image-preview-section,
    .palette-section {
        padding: 25px 15px;
    }
    .upload-area {
        padding: 30px 15px;
    }
    .upload-icon {
        font-size: 2.5rem;
    }
    .colors-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .color-preview {
        height: 120px;
    }
    .palette-title,
    .preview-title {
        font-size: 0.95rem;
        padding: 8px 18px;
    }
    .info-box {
        padding: 15px 20px;
    }
}

@media (max-width: 360px) {
    .page-title {
        font-size: 1.3rem;
    }
    .btn-upload {
        padding: 10px 25px;
        font-size: 12px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn-upload,
    .btn-generate,
    .btn-change,
    .btn-export,
    .copy-btn {
        min-height: 44px;
    }
    .color-card:hover {
        transform: none;
    }
    .color-card:active {
        transform: scale(0.98);
    }
}