:root {
    --primary-red: #e74c3c;
    --dark-red: #c0392b;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
    --black: #000000;
    --border-radius: 16px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --gradient: linear-gradient(135deg, #e60026 0%, #3e1f0f 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--white);
    color: var(--dark-gray);
    line-height: 1.6;
    padding: 20px;
    background-image: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    animation: fadeInDown 1s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo-icon {
    background: var(--gradient);
    color: var(--white);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 28px;
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}

h1 {
    color: var(--dark-gray);
    margin-bottom: 10px;
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff3b3b 0%, #8b4513 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--primary-red);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.tagline {
    color: #777;
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.upload-section {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    animation: fadeInLeft 1s ease;
    transition: var(--transition);
}

.upload-section:hover {
    box-shadow: var(--shadow-hover);
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: var(--border-radius);
    padding: 50px 20px;
    text-align: center;
    background-color: var(--light-gray);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary-red);
    background-color: #fff;
    transform: translateY(-5px);
}

.upload-area.active {
    border-color: var(--primary-red);
    background-color: rgba(231, 76, 60, 0.05);
}

.upload-icon {
    font-size: 70px;
    color: var(--primary-red);
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.upload-area p {
    margin-bottom: 20px;
    color: #666;
    font-size: 1.2rem;
}

.btn {
    background: var(--gradient);
    color: var(--white);
    border: none;
    padding: 14px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn i {
    margin-right: 10px;
}

.controls-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

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

.control-label {
    font-weight: 600;
    color: var(--dark-gray);
    display: flex;
    align-items: center;
}

.control-label i {
    margin-right: 8px;
    color: var(--primary-red);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-red);
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.slider-value {
    font-weight: 600;
    color: var(--primary-red);
    min-width: 40px;
    text-align: center;
}

.format-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.format-btn {
    flex: 1;
    padding: 18px;
    background-color: var(--light-gray);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.format-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.format-btn.active {
    background-color: rgba(231, 76, 60, 0.1);
    border-color: var(--primary-red);
    color: var(--primary-red);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.2);
}

.format-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.preview-section {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    animation: fadeInRight 1s ease;
    transition: var(--transition);
}

.preview-section:hover {
    box-shadow: var(--shadow-hover);
}

.image-preview-container {
    width: 100%;
    height: 350px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-gray);
    position: relative;
}

.image-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
    border-radius: var(--border-radius);
}

.placeholder-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
}

.placeholder-preview i {
    font-size: 70px;
    margin-bottom: 15px;
    color: #ddd;
}

.color-details-panel {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-top: 20px;
    border-left: 5px solid var(--primary-red);
    transition: var(--transition);
}

.color-details-panel:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.color-details-title {
    margin-bottom: 20px;
    color: var(--dark-gray);
    display: flex;
    align-items: center;
}

.color-details-title i {
    margin-right: 10px;
    color: var(--primary-red);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.detail-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    padding-left: 10px;
    border-radius: 8px;
}

.detail-label {
    font-weight: 600;
    color: var(--dark-gray);
}

.detail-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.palette-section {
    grid-column: 1 / -1;
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    animation: fadeInUp 1s ease;
    transition: var(--transition);
}

.palette-section:hover {
    box-shadow: var(--shadow-hover);
}

.palette-title {
    margin-bottom: 25px;
    color: var(--dark-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.palette-title i {
    margin-right: 10px;
    color: var(--primary-red);
}

.palette-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.color-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background-color: var(--white);
    transition: var(--transition);
    cursor: pointer;
    animation: fadeIn 0.5s ease;
}

.color-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.color-swatch {
    height: 140px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.color-details {
    padding: 20px;
}

.color-name {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.color-values {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.color-value {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.copy-btn {
    width: 100%;
    padding: 12px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background-color: var(--light-gray);
    border-color: var(--primary-red);
    color: var(--primary-red);
    transform: translateY(-2px);
}

.copy-btn i {
    margin-right: 5px;
}

footer {
    text-align: center;
    margin-top: 50px;
    color: #777;
    font-size: 0.9rem;
    padding: 20px;
    border-top: 1px solid #eee;
    animation: fadeIn 1s ease;
}

.footer-logo {
    color: var(--primary-red);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.loading {
    display: none;
    text-align: center;
    padding: 30px;
}

.spinner {
    border: 4px solid rgba(231, 76, 60, 0.2);
    border-left-color: var(--primary-red);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2ecc71;
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s ease;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.error {
    background-color: #e74c3c;
}

.shortcut-hint {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    text-align: center;
    color: #777;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* CMYK Color Simulation */
.cmyk-swatch {
    position: relative;
    overflow: hidden;
}

.cmyk-swatch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(0deg, rgba(0,0,0,var(--k)) 0%, rgba(0,0,0,var(--k)) 100%),
        linear-gradient(0deg, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 100%);
    background-blend-mode: multiply, normal;
    mix-blend-mode: multiply;
}

.cmyk-swatch::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="50" height="50" fill="cyan" opacity="0.3"/><rect x="50" width="50" height="50" fill="magenta" opacity="0.3"/><rect y="50" width="50" height="50" fill="yellow" opacity="0.3"/><rect x="50" y="50" width="50" height="50" fill="black" opacity="0.3"/></svg>') 0 0 / 20px 20px;
    mix-blend-mode: overlay;
    opacity: 0.2;
}
