/* Ad Containers */
.ad-container {
    width: 100%;
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    background: #f8f9fa;
    padding: 10px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.header-ad {
    margin: 0;
    padding: 15px 0;
    background: #f1f3f5;
    border-bottom: 1px solid var(--border-color);
}

.in-content-ad {
    margin: 2rem 0;
    padding: 15px 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Responsive Ad Sizing */
@media (max-width: 768px) {
    .ad-container {
        padding: 8px 0;
    }
    
    .header-ad {
        padding: 10px 0;
    }
    
    .in-content-ad {
        margin: 1.5rem 0;
    }
}

/* Base Styles & Variables */
:root {
    --primary-color: #4a6cf7;
    --primary-hover: #3a5ce4;
    --secondary-color: #6c757d;
    --background: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.75rem;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    display: inline-block;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

/* Converter Card */
.converter-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
}

.converter-section {
    display: none;
    animation: fadeIn 0.3s ease-out forwards;
}

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

/* Time Converter Specific Styles */
.time-converter {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.time-input-group,
.time-result {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.time-display {
    background-color: var(--background);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    text-align: center;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.equals-sign {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin: 0.5rem 0;
    color: var(--primary-color);
}

/* Responsive adjustments for time picker */
input[type="datetime-local"] {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: var(--card-bg);
    color: var(--text-color);
}

/* Hide the calendar icon in WebKit browsers */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    input[type="datetime-local"] {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .time-display {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        filter: invert(1);
    }
}

.converter-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.converter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    position: relative;
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2);
}

.input-group input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    font-size: 1.1rem;
    color: var(--text-color);
    background-color: transparent;
    min-width: 0; /* Prevent flex item from overflowing */
}

.input-group input:focus {
    outline: none;
}

.input-group select {
    padding: 0.875rem 1rem;
    border: none;
    border-left: 1px solid var(--border-color);
    background-color: transparent;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23718096' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.swap-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.swap-btn:hover {
    background-color: var(--primary-hover);
    transform: rotate(180deg);
}

.conversion-rate {
    text-align: center;
    margin: 1.5rem 0;
    font-size: 1.1rem;
    color: var(--text-light);
}

.last-updated {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Info Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.info-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

/* Footer */
.footer {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #cbd5e0;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
    padding-left: 0.25rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0aec0;
    font-size: 0.875rem;
}

/* Ad Space */
.ad-container {
    background-color: #f1f5f9;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.ad-space {
    background-color: #e2e8f0;
    border-radius: var(--border-radius);
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 76px;
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        box-shadow: var(--shadow-md);
        padding: 1rem 0;
        transform: translateY(-150%);
        transition: var(--transition);
        z-index: 999;
    }

    .main-nav.active {
        transform: translateY(0);
    }

    .main-nav ul {
        flex-direction: column;
        padding: 0 1.5rem;
        gap: 0.5rem;
    }

    .main-nav a {
        display: block;
        padding: 0.75rem 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .converter-form {
        flex-direction: column;
    }

    .swap-btn {
        margin: 0.5rem auto;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1a202c;
        --card-bg: #2d3748;
        --text-color: #e2e8f0;
        --text-light: #a0aec0;
        --border-color: #4a5568;
    }

    .converter-card,
    .info-card {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    }

    .input-group {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .input-group input,
    .input-group select {
        color: #e2e8f0;
        background-color: transparent;
    }

    .input-group select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0aec0' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    }

    .ad-container {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .ad-space {
        background-color: #4a5568;
        color: #cbd5e0;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.converter-section.active {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
