@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #F6F6F8;
    --card-bg: #FFFFFF;
    --text-primary: #111111;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --accent-blue: #007AFF;
    --accent-orange: #FF6B00;
    --accent-green: #00C853;
    --accent-purple: #8E24AA;

    --radius-lg: 24px;
    --radius-md: 12px;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.08);

    --transition-base: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0px;
    overflow-x: hidden;
}

/* --- Animations --- */
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate-enter {
    animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* --- Main Header --- */
.main-header {
    width: 100%;
    padding: 20px 0;
    margin-bottom: 40px;
}

.header-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    background: var(--text-primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }

.nav-links { display: flex; gap: 32px; }
.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-base);
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }

.header-right { display: flex; align-items: center; gap: 16px; }
.lang-switch-btn {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}
.lang-switch-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lang-switch-btn.hidden {
    display: none;
}

.xhs-badge {
    display: flex; align-items: center; gap: 6px;
    background: #ff2442; color: white;
    padding: 6px 12px; border-radius: 100px;
    font-size: 13px; font-weight: 600;
    cursor: default; transition: var(--transition-base);
}
.xhs-badge:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3); }

.github-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--card-bg); color: var(--text-primary);
    font-size: 20px; text-decoration: none;
    box-shadow: var(--shadow-sm); transition: var(--transition-base);
}
.github-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* --- Tool Page Nav --- */
.tool-nav {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 28px auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-nav .nav-left,
.tool-nav .nav-right {
    width: 120px;
    display: flex;
    align-items: center;
}

.tool-nav .nav-center {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border-radius: 999px;
    padding: 10px 18px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
}

.tool-nav .nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--text-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.tool-nav .nav-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.tool-nav .nav-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.tool-nav .nav-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --- Clock Hero --- */
.clock-hero { 
    text-align: center; 
    margin-bottom: 40px; 
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timezone-info {
    font-size: 14px; 
    color: var(--text-tertiary);
    margin-bottom: 12px; 
    cursor: pointer;
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 100px;
    transition: var(--transition-base);
    user-select: none;
    border: 1px solid transparent;
}
.timezone-info:hover { 
    color: var(--text-primary); 
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.time-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

#big-time {
    font-size: 180px; 
    font-weight: 800; 
    letter-spacing: -8px;
    color: var(--text-primary); 
    line-height: 1;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, var(--text-primary) 30%, #555 100%);
    -webkit-background-clip: text; 
    background-clip: text; 
    -webkit-text-fill-color: transparent;
}

.clock-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.copy-tick-btn {
    background: var(--card-bg); 
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 52px !important; 
    height: 52px !important; 
    border-radius: 16px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer; 
    color: var(--text-tertiary);
    transition: var(--transition-bounce); 
    box-shadow: var(--shadow-sm);
    flex-shrink: 0 !important;
}
.copy-tick-btn:hover { 
    transform: scale(1.1); 
    color: var(--text-primary); 
    box-shadow: var(--shadow-md);
}
.copy-tick-btn i { font-size: 24px; }

#big-date { font-size: 20px; font-weight: 500; color: var(--text-tertiary); margin-top: 10px; }

/* --- Hero --- */
.hero { text-align: center; margin-bottom: 60px; }
.hero h1 { font-size: 48px; font-weight: 700; letter-spacing: -1.5px; margin-bottom: 12px; }
.hero p { font-size: 18px; color: var(--text-tertiary); }

/* --- Grid Layout --- */
.tools-grid-wrapper { width: 100%; margin: 40px auto 100px auto; }
.grid-canvas {
    display: grid;
    grid-template-columns: repeat(2, 340px);
    justify-content: center;
    gap: 40px;
    padding: 20px;
}

/* --- Tool Card --- */
.tool-card {
    background: var(--card-bg);
    border-radius: 40px;
    padding: 32px;
    box-shadow: var(--shadow-md);
    display: flex !important;
    flex-direction: column !important;
    width: 340px !important;
    height: 320px !important;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 122, 255, 0.2);
}

.tool-card.selected {
    border-color: var(--accent-blue);
    background: linear-gradient(145deg, #ffffff, #f0f7ff);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1), var(--shadow-hover);
}

.card-icon {
    width: 64px; height: 64px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 24px; color: white; font-size: 32px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tool-card:hover .card-icon { transform: rotate(10deg) scale(1.1); }

.icon-blue { background: #3B82F6; }
.icon-orange { background: #F97316; }
.icon-purple { background: #A855F7; }
.icon-green { background: #10B981; }

.card-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.5px; }
.card-desc { color: var(--text-tertiary); font-size: 15px; margin-bottom: auto; }

.card-action-area { margin-top: 24px; width: 100%; }

/* --- Components inside Card --- */
.url-input-group {
    display: flex; background: #F2F2F7; border-radius: 12px;
    padding: 4px; width: 100%; align-items: center;
}
.url-input {
    background: transparent; border: none; padding: 10px 16px;
    flex-grow: 1; font-size: 14px; color: var(--text-primary); outline: none;
}
.go-btn {
    background: var(--accent-blue); color: white; border: none;
    border-radius: 8px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition-base);
}

.invoice-actions { display: flex; gap: 24px; align-items: center; }
.action-link {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
    text-decoration: none; transition: var(--transition-base);
}
.action-link.primary { color: var(--accent-orange); }

.dropzone {
    border: 2px dashed #E5E5EA; border-radius: 16px; height: 80px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-tertiary); font-size: 13px; transition: var(--transition-base);
}

.timestamp-box {
    background: #F8F9FA; border-radius: 12px; padding: 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.ts-label { font-size: 10px; font-weight: 700; color: #9CA3AF; text-transform: uppercase; display: block; }
.ts-value { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 600; color: #059669; }
.copy-btn {
    background: white; border: 1px solid #E5E5EA; width: 32px; height: 32px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary); transition: var(--transition-base);
}

/* --- Footer --- */
.footer {
    width: 100%; max-width: 960px; border-top: 1px solid #E5E5EA;
    padding: 32px 0; display: flex; justify-content: space-between; align-items: center;
    color: var(--text-secondary); font-size: 14px; margin: 40px auto 0 auto;
}
.footer-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.brand-icon {
    background: black; color: white; width: 24px; height: 24px;
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-tertiary); text-decoration: none; transition: var(--transition-base); }
.footer-links a:hover { color: var(--text-primary); }

/* --- Mobile --- */
@media (max-width: 768px) {
    #big-time { font-size: 80px; letter-spacing: -3px; }
    .grid-canvas { grid-template-columns: 340px; }
    .tool-card { width: 340px !important; margin: 0 auto; }
    .footer { flex-direction: column; gap: 20px; text-align: center; }
    .tool-nav {
        margin-bottom: 20px;
    }
    .tool-nav .nav-left,
    .tool-nav .nav-right {
        width: 60px;
    }
    .tool-nav .nav-center {
        padding: 8px 14px;
    }
}
