/* Global Styles */
:root {
    --primary-color: #2563eb;
    /* Modern Blue */
    --primary-dark: #1d4ed8;
    --secondary-color: #4f46e5;
    /* Indigo */
    --accent-color: #0ea5e9;
    /* Sky Blue */
    --background-color: #f8fafc;
    /* Slate 50 */
    --surface-color: #ffffff;
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --success-color: #10b981;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
}

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

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

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

button {
    cursor: pointer;
    font-family: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Header Styles */
header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-logo {
    height: 1.2em;
    width: auto;
    vertical-align: middle;
    margin-right: 0.5em;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

header .tagline {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Language Switcher Styles */
.lang-switcher {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    background: var(--text-main);
    color: white;
}

.lang-switcher a {
    color: #94a3b8 !important;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.lang-switcher a:hover,
.lang-switcher a.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

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

section {
    margin-bottom: 3rem;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
}

section h2 {
    color: var(--text-main);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Real-time Display */
.realtime-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.time-block {
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    color: white;
    text-align: center;
    transition: var(--transition);
}

.time-block:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.time-block h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.time-display {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.05em;
}

/* Converter Styles */
.main-converters-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.converter-container,
.timezone-converter {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    padding: 0;
    /* Reset padding as it's handled by children */
}

.tabs {
    display: flex;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
    gap: 0.5rem;
}

.tab-button {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.tab-button:hover {
    color: var(--text-main);
    background-color: rgba(0, 0, 0, 0.05);
}

.tab-button.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

form {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

select,
input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--background-color);
    color: var(--text-main);
    font-family: inherit;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: white;
}

/* Icon Button inside Input */
.icon-btn {
    position: absolute;
    right: 0.75rem;
    top: 2.2rem;
    /* Adjusted for label height */
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    transition: var(--transition);
    border-radius: 50%;
}

.icon-btn:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

.convert-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 1rem;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.convert-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
}

.convert-btn:active {
    transform: translateY(0);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.result {
    text-align: center;
    padding: 2rem;
    background-color: var(--background-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.result h3 {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result p {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-variant-numeric: tabular-nums;
}

.copy-btn {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

/* Timezone Converter */
.timezone-converter {
    padding: 2rem;
}

.timezone-inputs {
    display: grid;
    gap: 1rem;
}

.timezone-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.result-item {
    margin-bottom: 1rem;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.result-item span {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

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

.info-card {
    padding: 2rem;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.info-card h3 {
    color: var(--text-main);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
}

.info-card i {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
    padding: 0.75rem;
    border-radius: var(--radius-md);
}

.info-card p {
    color: var(--text-muted);
}

/* Conversion Chart */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

th {
    background-color: var(--background-color);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    color: var(--text-muted);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--background-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--text-main);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 600;
}

.btn:hover {
    background-color: black;
    transform: translateY(-2px);
}

/* FAQ Section */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 2rem;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary-color);
}

.faq-item h3 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.faq-item p {
    color: var(--text-muted);
}

/* Manual Section */
.manual-section {
    padding: 4rem 0;
    background-color: var(--background-color);
}

.manual-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.manual-card-mini {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.manual-card-mini:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.manual-card-mini h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.manual-card-mini h3 a {
    color: var(--text-main);
}

.manual-card-mini h3 a:hover {
    color: var(--primary-color);
}

.manual-meta {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.manual-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.manual-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background-color: var(--text-main);
    color: #94a3b8;
    padding: 4rem 0;
    text-align: center;
    font-size: 0.95rem;
}

footer p {
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .main-converters-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .realtime-display {
        grid-template-columns: 1fr;
    }

    .time-display {
        font-size: 2.5rem;
    }

    section {
        padding: 1.5rem;
    }
}

/* Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
    border-color: #ef4444 !important;
    /* Red-500 */
}

.input-error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}