/* HueCraft - Color Palette Generator Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main content */
main {
    padding: 40px 20px;
}

/* Palette container */
.palette-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.color-block {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.color-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.color-display {
    height: 200px;
    transition: all 0.3s ease;
    position: relative;
}

.color-info {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    min-height: 60px;
    position: relative;
}

.color-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
}

.hex-code {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #000000 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
    letter-spacing: 0.5px;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    min-width: 70px;
    text-align: left;
}

.hex-code:hover {
    color: #000000 !important;
    transform: scale(1.05);
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.9) !important;
}

.lock-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.lock-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.lock-btn.locked {
    background-color: #667eea;
    color: white;
}

/* Palette info */
.palette-info {
    text-align: center;
    margin-bottom: 20px;
}

.palette-type {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: capitalize;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.file-input-container {
    position: relative;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Saved palettes section */
.saved-palettes {
    background: #f8f9fa;
    padding: 40px 20px;
    border-top: 1px solid #e9ecef;
}

.saved-palettes h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
}

.saved-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.empty-state {
    text-align: center;
    color: #666;
    font-style: italic;
    grid-column: 1 / -1;
    padding: 40px;
}

.saved-palette {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.saved-palette:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.saved-palette-colors {
    display: flex;
    height: 100px;
}

.saved-color {
    flex: 1;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.saved-color:hover {
    transform: scale(1.05);
    z-index: 1;
}

.saved-palette-info {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saved-date {
    font-size: 0.9rem;
    color: #666;
}

.delete-palette {
    background: #ff4757;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.delete-palette:hover {
    background: #ff3742;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    header p {
        font-size: 1rem;
    }

    main {
        padding: 20px;
    }

    .palette-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .color-display {
        height: 150px;
    }

    .controls {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .saved-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .color-info {
        padding: 15px;
    }

    .hex-code {
        font-size: 1rem;
    }

    .saved-palettes {
        padding: 20px 10px;
    }
}

/* Animation for color changes */
@keyframes colorChange {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.color-changing .color-display {
    animation: colorChange 0.5s ease-in-out;
}

/* Loading state */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

.loading .btn-primary::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}