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

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
    background: #0a0a23;
    min-height: 100vh;
    font-weight: 400;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    font-display: swap;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top, #1e3c72 0%, transparent 50%),
        radial-gradient(ellipse at bottom, #2a5298 0%, transparent 50%),
        linear-gradient(45deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    animation: cosmicMove 20s ease-in-out infinite alternate;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: starsMove 50s linear infinite;
    z-index: -1;
    opacity: 0.8;
}

@keyframes cosmicMove {
    0% {
        transform: translateX(-10px) translateY(-10px) scale(1);
        filter: hue-rotate(0deg);
    }
    50% {
        transform: translateX(10px) translateY(10px) scale(1.02);
        filter: hue-rotate(90deg);
    }
    100% {
        transform: translateX(-5px) translateY(5px) scale(1.01);
        filter: hue-rotate(180deg);
    }
}

@keyframes starsMove {
    0% {
        transform: translateX(0) translateY(0);
    }
    100% {
        transform: translateX(-200px) translateY(-100px);
    }
}

header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    color: #000000;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    align-items: center;
    height: 56px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 1rem; /* horizontal padding only, height handled by line-height/height */
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    transition: all 0.25s ease;
    position: relative;
    background: transparent; /* keep the glass pill as the primary background */
    border: 1px solid transparent;
}

.nav-links a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.nav-links a.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.ad-banner {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    position: relative;
    flex: 1 0 auto;
}

.tool-section {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.tool-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.tool-section.active {
    display: block;
}

.tool-section h1,
.tool-section h2 {
    color: #ffffff;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
}

.tool-section h1 {
    font-size: 2.2rem;
}

.tool-section header {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    margin-bottom: 2rem;
}

.tool-description {
    text-align: center;
    color: #e6eaf3;
    font-size: 1.15rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

/* Home Page Styles */
.home-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.home-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.feature-card h3 {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Unit Converter Styles */
.converter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.converter-tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.4s;
}

.tab-btn.active {
    background: rgba(102, 126, 234, 0.3);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tab-btn:hover::before {
    left: 100%;
}

.converter-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.converter-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.converter-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.converter-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.converter-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.converter-box:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.converter-box label {
    display: block;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
}

.converter-box input,
.converter-box select {
    width: 100%;
    padding: 1.25rem;
    margin: 0.5rem 0;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 500;
    color: #2c3e50;
    background: #ffffff;
    transition: all 0.3s ease;
}

.converter-box input:focus,
.converter-box select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

#converter-result {
    background: #667eea;
    color: white;
    font-weight: bold;
}

/* Image Resizer Styles */
.resizer-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.resizer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.upload-area {
    text-align: center;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-area label {
    display: inline-block;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.upload-area label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.upload-area label:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.upload-area label:hover::before {
    left: 100%;
}

.resize-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-group label {
    min-width: 60px;
    font-weight: bold;
}

.control-group input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button {
    padding: 0.875rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.08);
}

.image-preview {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 2rem;
}

#image-canvas {
    max-width: 100%;
    border: 2px dashed #ddd;
    border-radius: 10px;
}

/* Code Screenshot Styles */
.code-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.code-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.code-controls {
    display: flex;
    gap: 1rem;
}

.code-controls select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

#code-input {
    width: 100%;
    height: 300px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

.code-preview {
    margin-top: 1rem;
}

#code-display {
    padding: 1.5rem;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 200px;
    border: 2px solid;
}

#code-display.dark {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

#code-display.light {
    background: #f7fafc;
    color: #2d3748;
    border-color: #e2e8f0;
}

#code-display.monokai {
    background: #272822;
    color: #f8f8f2;
    border-color: #49483e;
}

#code-display.dracula {
    background: #282a36;
    color: #f8f8f2;
    border-color: #44475a;
}

#code-display.github {
    background: #ffffff;
    color: #24292e;
    border-color: #e1e4e8;
}

#code-display.vscode {
    background: #1e1e1e;
    color: #d4d4d4;
    border-color: #3c3c3c;
}

#code-display.ocean {
    background: #0f4c75;
    color: #bbdaff;
    border-color: #3282b8;
}

#code-display.sunset {
    background: #2d1b69;
    color: #f093fb;
    border-color: #f093fb;
}

#code-display.gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    color: #ffffff;
    border-color: #667eea;
}

.code-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.code-actions button {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.code-actions button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.code-actions button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.code-actions button:hover::before {
    left: 100%;
}

/* Password Generator Styles */
.password-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.password-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.password-controls {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.password-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.length-control {
    margin-bottom: 2rem;
}

.length-control label {
    display: block;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #495057;
}

#length-value {
    color: #667eea;
    font-size: 1.2rem;
}

#password-length {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

#password-length::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

#password-length::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.character-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.password-output {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#generated-password {
    flex: 1;
    padding: 1rem;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.1rem;
    background: #f8f9fa;
}

.left-ad {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    z-index: 50;
}

.right-ad {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    z-index: 50;
}

footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.footer-content a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-content a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Performance optimizations */
* {
    will-change: auto;
}

.tool-section {
    contain: layout style;
}

img, canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Preload critical resources */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.nav-dropdown {
    display: none !important;
}
@media (max-width: 768px) {
    header {
        margin-bottom: 2.5rem;
    }
    .nav-links {
        flex-direction: column;
        gap: 1rem;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        padding: 0;
        margin-bottom: 1.5rem;
        display: none;
    }

    .nav-dropdown {
        display: block !important;
        width: 100%;
        max-width: 320px;
        margin: 0.5rem auto 1.5rem auto;
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
        border-radius: 20px;
        border: 1.5px solid rgba(255,255,255,0.25);
        background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(102,126,234,0.13) 100%);
        color: #fff;
        backdrop-filter: blur(18px) saturate(180%);
        -webkit-backdrop-filter: blur(18px) saturate(180%);
        box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 1.5px 0 rgba(255,255,255,0.18) inset;
        outline: none;
        transition: border 0.2s, box-shadow 0.2s;
    }
    .nav-dropdown:focus {
        border: 1.5px solid #667eea;
        box-shadow: 0 0 0 2px rgba(102,126,234,0.18);
    }
    .nav-dropdown option {
        color: #222;
        background: #fff;
    }
    
    .nav-links a {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .resizer-container {
        grid-template-columns: 1fr;
    }
    
    .converter-boxes {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .converter-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 200px;
    }
    
    .left-ad,
    .right-ad {
        display: none;
    }
    
    main {
        padding: 1rem;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tool-section h1 {
        font-size: 1.8rem;
    }
    
    .tool-section h2 {
        font-size: 1.6rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}