: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);
    --success: #4CAF50;
    --gradient-start: #6a11cb;
    --gradient-end: #2575fc;
    --footer-bg: #0a192f;
    --footer-text: #ccd6f6;
    --footer-heading: #e6f1ff;
    --footer-border: #233554;
    --footer-hover: #64ffda;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7ff 0%, #e4edf5 100%);
    color: white;
    line-height: 1.6;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.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;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px 16px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    color: black;
}

.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: 60px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 60px);
    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);
    }
}

/* Unit Converter Styles */
.converter-container {
    max-width: 1100px;
    margin: 80px auto 200px;
    padding: 20px;
}

.converter-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
    margin-top: 20px;
    color: var(--text-dark);
}

.converter-header {
    text-align: center;
    margin-bottom: 30px;
}

.converter-header h1 {
    font-size: 2.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: var(--footer-bg);
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.converter-header p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.7;
}

.converter-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

@media (min-width: 992px) {
    .converter-body {
        grid-template-columns: 1fr 3fr;
    }
}

.category-selector {
    background: var(--light-bg);
    border-radius: 14px;
    padding: 25px 20px;
    height: fit-content;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent-pink);
}

.category-title i {
    color: var(--accent-pink);
    font-size: 1.4rem;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 15px 18px;
    border-radius: 10px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.category-item:hover {
    background: var(--accent-pink);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 51, 102, 0.3);
}

.category-item.active {
    background: var(--secondary-blue);
    color: white;
    border-color: var(--secondary-blue);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

.category-item.active i {
    color: white;
}

.category-item i {
    font-size: 1.3rem;
    width: 30px;
    text-align: center;
    color: var(--secondary-blue);
    transition: color 0.3s;
}

.converter-section {
    background: var(--light-bg);
    border-radius: 14px;
    padding: 30px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.converter-title {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.converter-title i {
    color: var(--accent-pink);
    font-size: 1.6rem;
}

.converter-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

@media (max-width: 768px) {
    .converter-inputs {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1rem;
    padding-left: 5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    background: white;
    font-size: 1.2rem;
    transition: all 0.3s;
    font-weight: 500;
}

.input-wrapper input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
}

.input-wrapper select {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: white;
    border: none;
    border-left: 1px solid var(--border-color);
    padding: 0 15px;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230066cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
    font-weight: 500;
    color: var(--primary-blue);
}

.swap-btn {
    background: var(--accent-pink);
    color: white;
    border: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.4rem;
    align-self: flex-end;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(255, 51, 102, 0.3);
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.05);
    background: #ff1a55;
    box-shadow: 0 6px 15px rgba(255, 51, 102, 0.4);
}

.converter-result {
    margin-top: 30px;
    padding: 25px;
    background: var(--card-bg);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-title i {
    color: var(--accent-pink);
}

.result-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--success);
    text-align: center;
    padding: 20px;
    overflow-wrap: break-word;
    word-break: break-word;
    background: rgba(76, 175, 80, 0.08);
    border-radius: 10px;
    border: 2px dashed rgba(76, 175, 80, 0.3);
}

.conversion-formula {
    background: white;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    border-left: 4px solid var(--secondary-blue);
    overflow-wrap: break-word;
    word-break: break-word;
    color: var(--text-dark);
    font-weight: 500;
}

.common-conversions {
    margin-top: 40px;
}

.common-conversions h3 {
    font-size: 1.4rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.common-conversions h3 i {
    color: var(--accent-pink);
}

.conversions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.conversion-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent-pink);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

.conversion-item:hover {
    transform: translateY(-5px);
}

.conversion-value {
    font-weight: 700;
    color: var(--secondary-blue);
    font-size: 1.1rem;
}

.copyright {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.95rem;
}

.unit-highlight {
    background: rgba(255, 51, 102, 0.1);
    padding: 2px 8px;
    border-radius: 5px;
    color: var(--accent-pink);
    font-weight: 600;
}

/* 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);
    }

    .converter-header h1 {
        font-size: 2.2rem;
    }

    .converter-header p {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .header {
        height: 70px;
    }

    .logo a {
        font-size: 22px;
    }

    .mobile-sidebar {
        top: 70px;
        height: calc(100vh - 70px);
    }

    .converter-container {
        padding: 10px;
        margin-top: 90px;
    }

    .converter-card {
        padding: 20px;
        margin-top: 10px;
    }

    .converter-section {
        padding: 20px;
    }

    .input-wrapper input {
        padding: 14px 16px;
        font-size: 1.1rem;
    }

    .input-wrapper select {
        font-size: 0.9rem;
        padding-right: 35px;
    }

    .result-value {
        font-size: 1.8rem;
        padding: 15px;
    }

    .conversion-formula {
        font-size: 1rem;
        padding: 15px;
    }

    .conversions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .converter-header h1 {
        font-size: 1.8rem;
    }

    .converter-title {
        font-size: 1.2rem;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .swap-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .category-selector {
        padding: 20px 15px;
    }

    .category-item {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
}