:root {
    --primary-blue: #013d7a;
    --secondary-blue: #0066cc;
    --accent-pink: #ff3366;
    --light-bg: #f0f7ff;
    --card-bg: #ffffff;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e1e8f0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --footer-bg: #0a192f;
    --footer-text: #ccd6f6;
    --footer-heading: #e6f1ff;
    --footer-border: #233554;
    --footer-hover: #64ffda;
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #f72585;
    --success: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7ff 0%, #e4edf5 100%);
    color: var(--dark);
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: white;
    position: sticky;
    top: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo a {
    text-decoration: none;
    color: var(--footer-bg);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.logo a:hover {
    color: var(--accent-pink);
}

/* Navigation */
.nav-links {
    display: flex;
    margin-left: 30px;
}

.nav-item {
    position: relative;
    color: black;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px 16px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.links a {
    color: black;
    text-decoration: none;
    transition: all 0.3s ease;
}

.links a:hover {
    color: var(--accent-pink);
}

.nav-item:hover {
    color: var(--accent-pink);
}

.dropdown-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-item:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Mega Dropdown Styles */
.mega-dropdown {
    position: absolute;
    top: 45px;
    left: -750px;
    background-color: white;
    width: 1200px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 30px;
    display: none;
    z-index: 1001;
    grid-template-columns: repeat(6, 1fr);
    border-top: 3px solid var(--accent-pink);
}

.nav-item:hover .mega-dropdown {
    display: grid;
    animation: fadeIn 0.3s ease;
}

.dropdown-section h3 {
    color: var(--primary-blue);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.dropdown-section h3 i {
    margin-right: 10px;
    color: var(--accent-pink);
    background: rgba(255, 51, 102, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.7rem;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.dropdown-link:hover {
    background-color: #f0f7ff;
    color: var(--accent-pink);
}

.dropdown-link i {
    margin-right: 12px;
    color: var(--secondary-blue);
    width: 20px;
    text-align: center;
    font-size: 14px;
}

/* Mobile Toggle */
.mobile-toggle {
    margin-left: auto;
    display: none;
    background: none;
    border: none;
    color: var(--accent-pink);
    font-size: 24px;
    cursor: pointer;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: white;
    z-index: 999;
    transition: all 0.4s ease;
    overflow-y: auto;
    padding: 20px;
    box-shadow: var(--shadow);
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-category {
    margin-top: 20px;
}

.mobile-category-title {
    font-size: 18px;
    color: var(--primary-blue);
    font-weight: 500;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-pink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-category-title i {
    color: var(--accent-pink);
}

.mobile-tool-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    transition: all 0.2s;
    background: #f8fafd;
    color: var(--text-dark);
}

.mobile-tool-link:hover {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    transform: translateX(5px);
    color: var(--accent-pink);
}

.mobile-tool-link i {
    margin-right: 15px;
    color: var(--secondary-blue);
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
.color-container {
    max-width: 1400px;
    margin: 40px auto 200px;
    padding: 0 20px;
}

.color-tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.color-tool-title {
    font-size: 2.8rem;
    margin-bottom: 10px;
    color: var(--footer-bg);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-tool-subtitle {
    font-size: 1.2rem;
    color: #5a5a5a;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.7;
}

.color-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 30px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin: 20px;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title i {
    color: var(--accent);
}

.color-display {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ENHANCED COLOR SWATCH STYLES */
.color-swatch-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.color-swatch {
    flex: 1;
    min-width: 250px;
    height: 220px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.color-swatch:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.color-swatch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
}

.color-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.color-info-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-info-label i {
    color: var(--accent-pink);
}

.color-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.5px;
    font-family: 'Courier New', monospace;
}

.color-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 500;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label i {
    color: var(--accent);
}

.control-group input[type="color" i] {
    appearance: auto;
    inline-size: 50px;
    block-size: 50px;
    width: 100%;
    cursor: default;
    box-sizing: border-box;
    background-color: buttonface;
    color: buttontext;
    /* border-width: 1px; */
    /* border-style: solid; */
    border-color: buttonborder;
    border-image: initial;
    /* padding: 1px 2px; */
    cursor: pointer;
}

.control-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.control-group input[readonly] {
    background-color: #f9fbfd;
}

.color-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.value-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f3ff 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.value-title {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
    word-break: break-all;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.btn {
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent) 0%, #d00070 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(247, 37, 133, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(67, 97, 238, 0.1);
}

.color-blender {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.blender-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.blender-result {
    margin-top: 20px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.palette-title {
    grid-column: 1 / -1;
    font-size: 1.2rem;
    color: var(--secondary);
    margin-bottom: 15px;
}

.palette-color {
    height: 70px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.palette-color:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.palette-color span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px;
    font-size: 0.7rem;
    text-align: center;
}

.contrast-checker {
    margin-top: 30px;
}

.contrast-result {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f3ff 100%);
    border-radius: 12px;
    padding: 25px;
    margin-top: 15px;
    text-align: center;
}

.contrast-score {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 15px 0;
    color: var(--primary);
}

.rating {
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 30px;
    display: inline-block;
    margin-top: 10px;
}

.rating.good {
    background: rgba(76, 201, 240, 0.2);
    color: #1a936f;
}

.rating.bad {
    background: rgba(247, 37, 133, 0.2);
    color: #d00070;
}

.history-section {
    margin-top: 30px;
}

.history-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.history-color {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.history-color:hover {
    transform: scale(1.1);
}

.history-color span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px;
    font-size: 0.6rem;
    text-align: center;
}

/* footer */

.copyright {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 20px;
    text-align: center;
    margin-top: 50px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .mega-dropdown {
        width: 700px;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .mega-dropdown {
        width: 500px;
        grid-template-columns: repeat(2, 1fr);
    }

    .color-tool-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        height: 70px;
    }

    .logo a {
        font-size: 22px;
    }

    .mobile-sidebar {
        top: 70px;
        height: calc(100vh - 70px);
    }

    .color-tool-title {
        font-size: 2.2rem;
    }

    .color-swatch-container {
        flex-direction: column;
        height: 300px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .color-tool-title {
        font-size: 1.8rem;
    }

    .card {
        padding: 20px;
    }

    .color-values {
        grid-template-columns: 1fr;
    }

    .color-palette {
        grid-template-columns: repeat(3, 1fr);
    }
}