* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #003d5c;
    --secondary-color: #005073;
    --accent-color: #006a8a;
    --light-blue: #0088aa;
    --text-dark: #1a2332;
    --text-light: #5a6b7d;
    --bg-light: #e8f4f8;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 61, 92, 0.15);
    --shadow-hover: 0 12px 40px rgba(0, 61, 92, 0.35);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8f4f8 0%, #ffffff 50%, #e8f4f8 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

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



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

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

.header-title i {
    font-size: 50px;
    color: var(--primary-color);
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

 h1 {
    font-size: 48px;
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 61, 92, 0.1);
}



.controls-section {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.8s ease;
}

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

.search-box {
    position: relative;
    margin-bottom: 25px;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
}

.search-box input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    border: 2px solid var(--bg-light);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 92, 0.1);
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    padding: 12px 20px;
    border: 2px solid var(--bg-light);
    background: var(--white);
    color: var(--text-dark);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.filter-btn i {
    font-size: 16px;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    animation: fadeIn 1s ease;
}

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

.color-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.color-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
    z-index: 10;
}

.color-swatch {
    width: 100%;
    height: 120px;
    position: relative;
}

.color-swatch::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.color-card:hover .color-swatch::after {
    background: rgba(0, 0, 0, 0.1);
}

.color-info-card {
    padding: 12px;
    text-align: center;
}

.color-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-code {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-light);
    font-weight: bold;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.loading i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.loading p {
    font-size: 18px;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.no-results i {
    font-size: 60px;
    color: var(--primary-color);
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results p {
    font-size: 18px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-color-preview {
    min-height: 400px;
    position: relative;
    border-radius: 20px 0 0 20px;
}

.modal-color-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.1);
}

.modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.modal-info h2 {
    font-size: 28px;
    color: var(--text-dark);
    margin: 0;
}

.modal-code {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    color: var(--primary-color);
    font-weight: bold;
}

.color-values {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.value-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.value-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
}

.value-box {
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-dark);
    font-weight: bold;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-copy,
.btn-favorite {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-copy {
    background: var(--primary-color);
    color: var(--white);
}

.btn-copy:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-favorite {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-favorite:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-favorite.favorited {
    background: #e74c3c;
    color: var(--white);
    border-color: #e74c3c;
}

.btn-favorite.favorited i {
    font-weight: 900;
}

.color-harmony {
    margin-top: 10px;
}

.color-harmony h3 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.harmony-colors {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.harmony-color {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.harmony-color:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow);
}

.notification {
    position: fixed;
    top: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--light-blue));
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    font-weight: 600;
    z-index: 2000;
    animation: slideInRight 0.4s ease, slideOutRight 0.4s ease 2.6s;
    display: none;
}

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

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

.notification.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 1024px) {
    .colors-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 15px;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-color-preview {
        min-height: 250px;
        border-radius: 20px 20px 0 0;
    }

    .modal-info {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

    .header h1 {
        font-size: 32px;
    }

    .header p {
        font-size: 16px;
    }

    .controls-section {
        padding: 20px;
    }

    .filter-section {
        gap: 8px;
    }

    .filter-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .colors-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 12px;
    }

    .color-swatch {
        height: 80px;
    }

    .color-info-card {
        padding: 8px;
    }

    .color-name {
        font-size: 11px;
    }

    .color-code {
        font-size: 10px;
    }

    .modal-info {
        padding: 25px;
    }

    .modal-info h2 {
        font-size: 22px;
    }

    .modal-code {
        font-size: 18px;
    }

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

    .harmony-colors {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
}