/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #0d3735;
    background: linear-gradient(135deg, #0d3735 0%, #1a5f5c 50%, #2d8a85 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: nowrap;
}


.nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: nowrap;
    overflow: hidden;
}

.nav-link {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #0d3735;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #0d3735, #1a5f5c, #2d8a85);
    border-radius: 1px;
}

.language-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.language-selector h4 {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.language-selector select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.language-selector select:focus {
    outline: none;
    border-color: #0d3735;
    box-shadow: 0 0 0 3px rgba(13, 55, 53, 0.1);
}

.language-name {
    font-size: 0.8rem;
    color: #0d3735;
    text-align: center;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
}

.sidebar {
    width: 300px;
    background: #f9fafb;
    border-left: 1px solid #e5e7eb;
    padding: 2rem;
    position: sticky;
    top: 80px;
    height: fit-content;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #0d3735, #1a5f5c, #2d8a85);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Featured Tools */
.featured-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.tool-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #0d3735;
}

.tool-card.coming-soon {
    opacity: 0.7;
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.tool-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tool-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #0d3735, #1a5f5c, #2d8a85);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.tool-button::before {
    content: "🚀";
    font-size: 1.1rem;
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(13, 55, 53, 0.3);
}

.tool-button.disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Converter Section */
.converter-section {
    max-width: 800px;
    margin: 0 auto;
}

.converter-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    background: linear-gradient(135deg, #0d3735, #1a5f5c, #2d8a85);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.converter-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 3rem;
    text-align: center;
}

.converter-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.conversion-mode {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.mode-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.mode-label input[type="radio"] {
    margin: 0;
    accent-color: #667eea;
}

.input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.input-group input,
.input-group select {
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #0d3735;
    box-shadow: 0 0 0 3px rgba(13, 55, 53, 0.1);
}

.convert-button {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #0d3735, #1a5f5c, #2d8a85);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    height: fit-content;
    position: relative;
}

.convert-button::before {
    content: "🚀";
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.convert-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(13, 55, 53, 0.3);
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.results-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.result-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: #f3f4f6;
    border-color: #0d3735;
}

.result-system {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.result-size {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0d3735;
}

/* Info Section */
.info-section {
    background: #f9fafb;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

.info-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.info-card h4 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.info-card p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Ad Container */
.ad-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.ad-container h4 {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-placeholder {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 4px;
    border: 2px dashed #d1d5db;
}

/* Mobile Ad Container */
.mobile-ad-container {
    display: none;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin: 2rem 0;
    text-align: center;
}

.mobile-ad-container h4 {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-ad-placeholder {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 4px;
    border: 2px dashed #d1d5db;
}

/* Show mobile ads on mobile devices */
@media (max-width: 768px) {
    .mobile-ad-container {
        display: block;
    }
    
    .sidebar .ad-container {
        display: none;
    }
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 2rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    color: #9ca3af;
    margin: 0;
}

.share-buttons {
    display: flex;
    gap: 1rem;
}

.share-button {
    background: #374151;
    color: white;
    border: 1px solid #4b5563;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.share-button:hover {
    background: #4b5563;
    border-color: #6b7280;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .share-buttons {
        justify-content: center;
    }
}

/* Mobile-First Responsive Design */

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #667eea;
    padding: 0.5rem;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav .nav-link {
    display: block;
    padding: 1rem 2rem;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.mobile-nav .nav-link:hover,
.mobile-nav .nav-link.active {
    background-color: #f9fafb;
    color: #0d3735;
}

.mobile-language-selector {
    padding: 1rem 2rem;
    border-top: 1px solid #f3f4f6;
    background-color: #f9fafb;
}

.mobile-language-selector label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.mobile-language-selector select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.mobile-language-selector select:focus {
    outline: none;
    border-color: #0d3735;
    box-shadow: 0 0 0 3px rgba(13, 55, 53, 0.1);
}

/* Touch-friendly improvements */
.convert-button,
.tool-button,
.share-button {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.input-group input,
.input-group select {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Enhanced touch targets for mobile */
@media (max-width: 768px) {
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
    }
    
    .mode-label {
        min-height: 44px;
        padding: 0.75rem;
        cursor: pointer;
    }
    
    .mode-label input[type="radio"] {
        transform: scale(1.2);
        margin-right: 0.75rem;
    }
    
    .language-selector select {
        min-height: 44px;
        font-size: 16px;
        padding: 0.75rem 1rem;
    }
    
    .mobile-menu-toggle {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
    }
    
    /* Improve scrolling on mobile */
    .main-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better focus states for touch devices */
    .convert-button:focus,
    .tool-button:focus,
    .share-button:focus {
        outline: 2px solid #0d3735;
        outline-offset: 2px;
    }
    
    /* Prevent text selection on buttons */
    .convert-button,
    .tool-button,
    .share-button,
    .mobile-menu-toggle {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* Enhanced mobile layout */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        max-width: 100%;
    }
    
    .ad-container {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 1rem;
        position: relative;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 1rem;
    }
    
    .sidebar .language-selector {
        display: none;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.5;
    }
    
    .featured-tools {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .input-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .converter-container {
        padding: 1.5rem;
        margin: 0 -0.5rem;
    }
    
    .content-wrapper {
        padding: 1.5rem 1rem;
    }
    
    .conversion-mode {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .mode-label {
        padding: 0.75rem;
        background: white;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .converter-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .converter-subtitle {
        font-size: 1.1rem;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.75rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .converter-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .tool-card {
        padding: 1.25rem;
    }
    
    .converter-container {
        padding: 1.25rem;
        margin: 0;
    }
    
    .content-wrapper {
        padding: 1rem 0.75rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .conversion-mode {
        padding: 1rem;
    }
    
    .input-section {
        gap: 1.25rem;
    }
    
    .convert-button {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    .tool-button {
        width: 100%;
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .share-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .share-button {
        flex: 1;
        min-width: 120px;
        margin: 0.25rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.6rem;
    }
    
    .converter-title {
        font-size: 1.6rem;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .converter-container {
        padding: 1rem;
    }
    
    .content-wrapper {
        padding: 0.75rem 0.5rem;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        margin-bottom: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .converter-title {
        font-size: 2rem;
    }
    
    .featured-tools {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-icon {
        transform: scale(1.1);
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .logo-icon {
        animation: none;
    }
    
    .convert-button:hover,
    .tool-button:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mobile-nav {
        background: #1f2937;
        border-top-color: #374151;
    }
    
    .mobile-nav .nav-link {
        color: #d1d5db;
        border-bottom-color: #374151;
    }
    
    .mobile-nav .nav-link:hover,
    .mobile-nav .nav-link.active {
        background-color: #374151;
        color: #2d8a85;
    }
}

/* Mobile-specific performance optimizations */
@media (max-width: 768px) {
    /* Optimize animations for mobile */
    .logo-icon {
        animation-duration: 4s; /* Slower animation on mobile */
    }
    
    /* Improve text rendering on mobile */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    /* Better spacing for mobile content */
    .converter-section {
        margin-bottom: 1rem;
    }
    
    .info-section {
        margin-top: 1.5rem;
    }
    
    /* Optimize grid layouts for mobile */
    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .result-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .result-size {
        font-size: 1.1rem;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .input-group input,
    .input-group select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .mobile-menu-toggle {
        -webkit-touch-callout: none;
    }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
    .input-group select {
        background-image: none;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* Clothing Converter Specific Styles */
.converter-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.input-group select,
.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: #0d3735;
    box-shadow: 0 0 0 3px rgba(13, 55, 53, 0.1);
}


.convert-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #0d3735, #1a5f5c, #2d8a85);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.convert-button::before {
    content: "🚀";
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.convert-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 55, 53, 0.3);
}

.size-guide-section {
    margin-top: 3rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

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

.guide-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.guide-card h3 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.guide-card p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .size-guide-grid {
        grid-template-columns: 1fr;
    }
}
.mt-3 { margin-top: 1.5rem; }
