/* =====================================
   RESET
===================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.5;

    background: var(--bg);
    color: var(--text);

    transition:
        background .25s ease,
        color .25s ease;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =====================================
   VARIABLES
===================================== */

:root {

    --primary: #2563eb;
    --primary-hover: #1d4ed8;

    --bg: #f8fafc;
    --card: #ffffff;

    --text: #0f172a;
    --muted: #64748b;

    --border: #e2e8f0;

    --shadow:
        0 10px 30px rgba(15, 23, 42, .08);

    --radius: 18px;
}

/* =====================================
   DARK MODE
===================================== */

html[data-theme="dark"] {

    --bg: #0f172a;
    --card: #1e293b;

    --text: #f8fafc;
    --muted: #94a3b8;

    --border: #334155;

    --shadow:
        0 10px 30px rgba(0,0,0,.35);
}

/* =====================================
   LAYOUT
===================================== */

.container {
    width: 100%;
    max-width: 1180px;

    margin: 0 auto;
    padding: 0 20px;
}

main {
    padding-bottom: 60px;
}

/* =====================================
   HERO
===================================== */

.hero {

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #3b82f6
        );

    color: white;

    padding:
        50px
        0
        70px;
}

.hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.hero h1 {

    margin: 0;

    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 1.1;
}

.hero-subtitle {

    margin-top: 14px;

    max-width: 720px;

    font-size: 1.1rem;

    opacity: .95;
}

/* =====================================
   THEME BUTTON
===================================== */

.theme-toggle {

    width: 50px;
    height: 50px;

    border: none;

    border-radius: 50%;

    background: rgba(255,255,255,.15);

    color: white;

    font-size: 20px;

    backdrop-filter: blur(8px);

    transition: .2s ease;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

/* =====================================
   SECTION
===================================== */

.calculator-section {
    margin-top: -35px;
}

.calculator-message {
    margin-top: 16px;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

/* =====================================
   CARD
===================================== */

.card {

    background: var(--card);

    border-radius: var(--radius);

    padding: 28px;

    box-shadow: var(--shadow);

    margin-bottom: 24px;

    border: 1px solid var(--border);
}

.card h2 {

    margin-top: 0;
    margin-bottom: 24px;

    font-size: 1.4rem;
}

/* =====================================
   TABS
===================================== */

.tabs {

    display: flex;

    gap: 10px;

    margin-bottom: 24px;
}

.tab-button {

    border: none;

    background: var(--card);

    color: var(--text);

    padding: 14px 20px;

    border-radius: 12px;

    font-weight: 600;

    border: 1px solid var(--border);

    transition: .2s ease;
}

.tab-button.active {

    background: var(--primary);

    color: white;

    border-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* =====================================
   TIME INPUTS
===================================== */

.time-pair {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 20px;
}

.time-group label {

    display: block;

    margin-bottom: 12px;

    font-weight: 600;
}

.time-inputs {

    display: flex;

    gap: 12px;
}

.time-inputs input {

    width: 100%;
    min-width: 0;

    height: 60px;

    border-radius: 14px;

    border: 1px solid var(--border);

    background: var(--bg);

    color: var(--text);

    text-align: center;

    font-size: 22px;
    font-weight: 700;

    transition: .2s ease;
}

.time-inputs input:focus {

    outline: none;

    border-color: var(--primary);

    box-shadow:
        0 0 0 4px
        rgba(37,99,235,.15);
}

/* =====================================
   OPERATIONS
===================================== */

.operation-row {

    display: flex;

    align-items: center;

    gap: 14px;

    margin-bottom: 14px;
}

.operator-btn {

    width: 54px;
    height: 54px;

    border: none;

    border-radius: 14px;

    background: var(--primary);

    color: white;

    font-size: 24px;
    font-weight: 700;

    flex-shrink: 0;
}

.add-row-btn {

    margin-top: 8px;

    width: 100%;

    height: 56px;

    border: 2px dashed var(--border);

    background: transparent;

    color: var(--text);

    border-radius: 14px;

    font-weight: 600;

    transition: .2s ease;
}

.add-row-btn:hover {

    border-color: var(--primary);

    color: var(--primary);
}

/* =====================================
   RESULT
===================================== */

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

.result-main {
    margin-bottom: 30px;
}

.result-time {

    font-size: clamp(2rem, 5vw, 3.6rem);

    font-weight: 800;

    margin-bottom: 12px;
}

.result-text {

    font-size: 1.05rem;

    color: var(--muted);
}

.result-human{
    font-size:1.1rem;
    font-weight:600;
    margin-top:12px;
}

.result-words{
    margin-top:10px;
    color:var(--muted);
    line-height:1.6;
}

/* =====================================
   STATS
===================================== */

.stats-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 16px;

    margin-bottom: 30px;
}

.stat-box {

    background: var(--bg);

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 18px;
}

.stat-label {

    display: block;

    color: var(--muted);

    font-size: .9rem;

    margin-bottom: 6px;
}

.stat-box span:last-child {

    font-size: 1.4rem;

    font-weight: 700;
}

/* =====================================
   EQUIVALENT
===================================== */

.equivalent-block {

    text-align: left;

    background: var(--bg);

    border-radius: 14px;

    padding: 20px;
}

.equivalent-block h3 {

    margin-top: 0;
}

.equivalent-block ul {

    margin: 0;
    padding-left: 18px;
}

.equivalent-block li {

    margin-bottom: 8px;
}

/* =====================================
   SHARE
===================================== */

.share-wrapper {

    display: flex;

    gap: 12px;
}

#shareUrl {

    flex: 1;

    height: 54px;

    border-radius: 12px;

    border: 1px solid var(--border);

    padding: 0 16px;

    background: var(--bg);

    color: var(--text);
}

#copyLinkBtn {

    border: none;

    background: var(--primary);

    color: white;

    padding: 0 22px;

    border-radius: 12px;

    font-weight: 600;
}

.copy-success {

    margin-top: 12px;

    color: #16a34a;

    display: none;
}

/* =====================================
   CONVERTER
===================================== */

.converter-grid {

    display: grid;

    grid-template-columns:
        1fr
        1fr
        1fr;

    gap: 14px;
}

.converter-grid input,
.converter-grid select {

    height: 54px;

    border-radius: 12px;

    border: 1px solid var(--border);

    background: var(--bg);

    color: var(--text);

    padding: 0 14px;
}

.converter-result {

    margin-top: 20px;

    text-align: center;

    font-size: 2rem;

    font-weight: 800;
}

.remove-row-btn{
    width:54px;
    height:54px;
    border:none;
    border-radius:14px;
    background:#ef4444;
    color:#fff;
    font-size:24px;
    font-weight:700;
    flex-shrink:0;
}

/* =====================================
   FAQ
===================================== */

.faq-section {

    padding: 20px 0;
}

.faq-section h2 {
    margin-bottom: 24px;
}

/* =====================================
   ARTICLE
===================================== */

.article-section {

    padding: 20px 0 60px;
}

.article-section article {

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 30px;

    box-shadow: var(--shadow);
}

/* =====================================
   FOOTER
===================================== */

footer {

    border-top: 1px solid var(--border);

    padding: 30px 0;

    text-align: center;

    color: var(--muted);
}

/* =====================================
   HOVER EFFECTS
===================================== */

.card,
.tab-button,
.operator-btn,
#copyLinkBtn,
.add-row-btn {

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.card:hover {

    transform: translateY(-2px);
}

/* =====================================
   MOBILE
===================================== */

@media (max-width: 900px) {

    .time-pair {

        grid-template-columns: 1fr;
    }

    .stats-grid {

        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .hero {

        padding:
            40px
            0
            60px;
    }

    .hero-top {

        flex-direction: column;
    }

    .tabs {

        flex-direction: column;
    }

    .tab-button {

        width: 100%;
    }

    .operation-row {

        flex-direction: column;
        align-items: stretch;
    }

    .operator-btn {

        width: 100%;
    }

    .share-wrapper {

        flex-direction: column;
    }

    .converter-grid {

        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {

    .container {

        padding: 0 14px;
    }

    .card {

        padding: 20px;
    }

    .time-inputs {

        gap: 8px;
    }

    .time-inputs input {

        height: 56px;

        font-size: 18px;
    }

    .result-time {

        font-size: 2.2rem;
    }

    .stat-box span:last-child {

        font-size: 1.2rem;
    }
}