/* =====================================================
   1. Variables
   ===================================================== */

:root {

    /* Colors */

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;

    --background: #f8fafc;
    --surface: #ffffff;

    --text: #0f172a;
    --text-secondary: #64748b;

    --border: #e2e8f0;


    /* Shadows */

    --shadow-sm:
        0 4px 12px rgba(15, 23, 42, 0.05);

    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.08);

    --shadow-lg:
        0 20px 50px rgba(15, 23, 42, 0.12);


    /* Border Radius */

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 24px;


    /* Layout */

    --container-width: 1100px;

}


/* =====================================================
   2. Reset
   ===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}
body {

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Tahoma,
        Arial,
        sans-serif;

    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;

}

button,
input,
select,
textarea {

    font: inherit;

}
button {
    cursor: pointer;
}
a {
    color: inherit;
}


/* =====================================================
   3. Global Layout
   ===================================================== */

main {
    padding:10px 0 60px 0;
    width: min(var(--container-width),calc(100% - 32px));
    margin-inline: auto;
}

/* =====================================================
   4. Header
   ===================================================== */

header {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.header-container {

    width: min( var(--container-width), calc(100% - 32px));
    margin-inline: auto;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items:center;
    gap: 10px;
    text-decoration:none;
    color:var(--text);
}
.logo-icon {

    width: 40px;
    height: 40px;
    object-fit: contain;
    background: var(--primary-light);
    border-radius: 12px;

}
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.logo-text strong {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}
.logo-text span {
    font-size:14px;
    color: var(--text-secondary);
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav a {
    text-decoration: none;
    color:  var(--text-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: clamp(14px,2vw,16px);
    font-weight: 700;
    transition:
        color 0.2s ease,
        background 0.2s ease;

}
.nav a:hover,
.nav a.active {
    color: var(--primary);
    background: var(--primary-light);
}


/* =====================================================
   7. Page Title
   ===================================================== */

.page-title {
    text-align: center;
    margin-bottom:10px;

}
.page-title h1 {
    font-size: clamp(22px,5vw,32px);
    margin-bottom: 10px;
}
.page-title p {
    color: var(--text-secondary);
    font-size: clamp(14px,2vw,16px);
}


/* =====================================================
   9. Date Display Card
   ===================================================== */

.date-display-card {

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(28px,6vw,55px);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    text-align: center;

}
/* Day Name */
.day-name {
    display: inline-flex;
    padding: 8px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
}
/* Date Label */
.date-label {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}
/* Date Text */
.date-text {

    font-size: clamp(22px,5vw,32px);
    font-weight: bold;
    line-height: 1.3;

}
/* Numeric Date Row */
.numeric-date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}
/* Numeric Date */
.numeric-date {
    color: var(--text-secondary);
    font-size:  clamp(16px,3vw,22px);
    font-weight: bold;
    direction: ltr;
    unicode-bidi: plaintext;
}
/* Separator */
.separator {
    width: 70px;
    height: 1px;
    background: var(--border);
    margin: 20px auto;
}

/* Copy Date Button */
.copy-date-button {

    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}
.copy-date-button:hover {

    border-color: var(--primary);

    background: var(--primary-light);

    color: var(--primary);

    transform: translateY(-1px);

}
.copy-full-button {
    justify-self: center;
    margin-top: 35px;
    width: 100%;
    max-width: 320px;
}


/* Date Navigation */

.date-navigation {

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 40px;
    padding-top: 25px;
    border-top:
        1px solid var(--border);
}
.date-navigation button {

    min-height:
        48px;

    padding:
        10px;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    color:
        var(--text);

    font-weight:
        600;

    box-shadow:
        var(--shadow-sm);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;

}
.date-navigation button:hover {

    transform:
        translateY(-2px);

    border-color:
        var(--primary);

    background:
        var(--primary-light);

    color:
        var(--primary);

}

/* Today Button */
.date-navigation .today-button {

    background: var(--primary);
    border-color: var(--primary);
    color:  white;
}
.date-navigation .today-button:hover {

    background:
        var(--primary-dark);

    border-color:
        var(--primary-dark);

    color:
        white;

}

/* Two Navigation Buttons */
.date-navigation-two {

    grid-template-columns: repeat(2, 1fr);

}

/* =====================================================
   12. Buttons
   ===================================================== */

.button {

    min-height:
        48px;

    padding:
        10px 18px;

    border:
        none;

    border-radius:
        var(--radius);

    font-size:
        14px;

    font-weight:
        700;

    cursor:
        pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;

}
.button:hover {

    transform:
        translateY(-2px);

}
.button:active {

    transform:
        translateY(0)
        scale(0.98);

}
.button-primary {

    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);

}
.button-primary:hover {

    background:
        var(--primary-dark);

    box-shadow:
        0 12px 25px
        rgba(37, 99, 235, 0.3);

}
.button-secondary {

    background: #f1f5f9;
    color: var(--text);
    border: 1px solid var(--border);

}
.button-secondary:hover {

    background:
        #e2e8f0;

}
.button-outline {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.button-outline:hover {

    background:
        var(--primary-light);

    color:
        var(--primary);

    border-color:
        var(--primary);

}


/* =====================================================
   19. Tools
   ===================================================== */

.tools-grid {
    margin-top: 20px;
    display: grid;

    grid-template-columns: repeat(auto-fit,minmax(250px, 1fr));

    gap:16px;
}

.tool-card {

    display:
        flex;

    flex-direction:
        column;

    min-height:
        210px;

    padding: 20px;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-lg);

    text-decoration:
        none;

    color:
        var(--text);

    box-shadow:
        var(--shadow-sm);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;

}

.tool-card:hover {

    transform:
        translateY(-4px);

    border-color:
        var(--primary);

    box-shadow:
        var(--shadow);

}

.tool-card-icon {

    width:
        50px;

    height:
        50px;

    display:
        grid;

    place-items:
        center;

    margin-bottom:
        22px;

    background:
        var(--primary-light);

    border-radius:
        var(--radius);

    font-size:
        24px;

}



.tool-card-content h2 {

    font-size: clamp(18px,2vw,20px);
    margin-bottom: 8px;

}


.tool-card-content p {

    color:
        var(--text-secondary);

    font-size: clamp(14px,2vw,16px);

    line-height:
        1.7;

}



   /* =====================================================
   Articles
   ===================================================== */


.articles-grid {

    margin-top: 20px;
    display:
        grid;

    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                1fr
            )
        );

    gap:
        16px;

}
.article-card {

    display:
        flex;

    flex-direction:
        column;

    gap:
        12px;

    padding:
        20px;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    color:
        inherit;

    text-decoration:
        none;

    transition:
        border-color 0.2s ease,
        transform 0.2s ease;

}
.article-card:hover {

    border-color:
        var(--primary);

    transform:
        translateY(-2px);

}
.article-card h2 {

    margin:
        0;

    color:
        var(--text);

    font-size:clamp(18px,2vw,20px);

    font-weight:
        700;

}


.article-card p {

    margin:
        0;

    color:
        var(--text-secondary);

    font-size:clamp(14px,2vw,16px);

    line-height:
        1.7;

}


/* =====================================================
   8. Generic Card
   ===================================================== */

.card {

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0px;
}
.card-title {

    margin-bottom:
        22px;

    font-size:clamp(18px,2vw,20px);

    font-weight:
        700;

}


/* =====================================================
   Result Card
   ===================================================== */

.result-card {

    display:
        flex;

    flex-direction:
        column;

    gap:
        14px;

}


.result-card > div {

    display:
        flex;

    align-items:
        center;

    justify-content:
        flex-start;

    gap:
        16px;

    padding:
        16px 0;

    border-bottom:
        1px solid var(--border);

}


.result-card > div:last-child {

    padding-bottom:
        0;

    border-bottom:
        none;

}


/* Label */

.result-card span {

    color:
        var(--text-secondary);

    font-size:clamp(16px,2vw,18px);

}
/* Result */

.result-card strong {

    color:
        var(--text);

    font-size:clamp(16px,2vw,18px);

    font-weight:
        700;

}


.age-result {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        16px;

}


.age-result > div {

    display:
        flex;

    align-items:
        baseline;

    gap:
        5px;

}


.age-result strong {

    color:
        var(--primary);

    font-size:
        clamp(
            24px,
            5vw,
            34px
        );

    font-weight:
        800;

}


.age-result span {

    color:
        var(--text-secondary);

    font-size:
        14px;

    font-weight:
        600;

}


/* =====================================================
   15. Choice Selector
   ===================================================== */

.choice-grid {

    display:
        grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap:
        12px;

    margin-bottom:
        22px;

}


.choice-option {

    position:
        relative;

    display:
        block;

    cursor:
        pointer;

}


.choice-option input {

    position:
        absolute;

    opacity:
        0;

    pointer-events:
        none;

}


.choice-option-content {

    display:
        flex;

    flex-direction:
        column;

    gap:
        6px;

    min-height:
        100px;

    padding:
        20px;

    background: var(--background);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;

}


.choice-option:hover .choice-option-content {

    border-color:
        var(--primary);

}


.choice-option input:checked + .choice-option-content {

    background:
        var(--primary-light);

    border-color:
        var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.1);

}


.choice-option-title {

    color:
        var(--text);

    font-size:clamp(16px,2vw,18px);

    font-weight:
        700;

}


.choice-option input:checked
+ .choice-option-content
.choice-option-title {

    color:
        var(--primary);

}


.choice-option-description {

    color:
        var(--text-secondary);

    font-size:clamp(12px,2vw,14px);

}


/* =====================================================
   16. Date Form Card
   ===================================================== */

.date-form-card {

    padding:
        20px;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-lg);

    box-shadow:
        var(--shadow-sm);

}


.date-form-title {

    margin-bottom:
        22px;

    font-size:clamp(18px,2vw,20px);

    font-weight:
        700;

}
.date-form-title2 {

    margin-bottom: 22px;
    margin-top: 22px;

    font-size:clamp(16px,2vw,18px);

    font-weight: 700;

}


.date-inputs {

    display:
        grid;

    grid-template-columns:
        1fr 2fr 1fr;

    gap:
        14px;

}


.date-field {

    display:
        flex;

    flex-direction:
        column;

    gap:
        8px;

}


.date-field label {

    color:
        var(--text-secondary);

    font-size: 14px;
    font-weight: bold;
}


.date-field input,
.date-field select {

    width:
        100%;

    height:
        50px;

    padding:
        0 14px;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-sm);

    color:
        var(--text);

    outline:
        none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;

}


.date-field input:focus,
.date-field select:focus {

    border-color:
        var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.1);

}


/* =====================================================
   17. Form Actions
   ===================================================== */

.form-actions {

    display:
        flex;

    justify-content:
        center;

    margin-top:
        24px;

}


.form-submit {

    width:
        100%;

    max-width:
        320px;

    min-height:
        52px;

    font-size:
        16px;

}


/* =====================================================
   18. Result Heading
   ===================================================== */

.result-heading {

    text-align:
        center;

    margin:
        35px 0 18px;

    color:
        var(--text-secondary);

    font-size:
        15px;

    font-weight:
        700;

}



/* =====================================================
   20. Toast
   ===================================================== */

.toast {

    position:
        fixed;

    left:
        50%;

    bottom:
        30px;

    transform:
        translateX(-50%)
        translateY(100px);

    background:
        var(--text);

    color:
        white;

    padding:
        12px 20px;

    border-radius:
        999px;

    font-size:
        14px;

    font-weight:
        600;

    opacity:
        0;

    pointer-events:
        none;

    z-index:
        1000;

    box-shadow:
        var(--shadow-lg);

    transition:
        0.3s ease;

}


.toast.show {

    opacity:
        1;

    transform:
        translateX(-50%)
        translateY(0);

}


/* =====================================================
   21. Footer
   ===================================================== */

footer {

    border-top:
        1px solid var(--border);

    padding:
        24px 16px;

    text-align:
        center;

    color:
        var(--text-secondary);

    font-size:
        13px;

}

/* =====================================================
   Tables
   ===================================================== */

.table-wrapper {

    width:
        100%;

    overflow-x:
        auto;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow-sm);

}


.content-table {

    width:
        100%;

    border-collapse:
        collapse;

    text-align:
        right;

}

.content-table thead {

    background:
        var(--primary-light);

}


.content-table th {

    padding:
        16px 20px;

    color:
        var(--primary);

    font-size:
        16px;

    font-weight:
        700;

    white-space:
        nowrap;

}

.content-table td {

    padding:
        16px 20px;

    color:
        var(--text);

    font-size:
        16px;

    border-top:
        1px solid var(--border);

}


.content-table tbody tr {

    transition:
        background 0.2s ease;

}


.content-table tbody tr:hover {

    background:
        var(--primary-light);

}


.content-table td:first-child {

    font-weight:
        700;

    color:
        var(--primary);

}


/* =====================================================
   22. Responsive
   ===================================================== */


@media (max-width: 650px) {

    .date-navigation {
        grid-template-columns: 1fr 1fr;
    }
    .date-navigation .today-button {

        grid-column: 1 / -1;
        order: -1;
    }


    .choice-grid {

        grid-template-columns:
            1fr;

    }


    .date-inputs {

        grid-template-columns:
            1fr;

    }


    .date-form-card {

        padding:
            20px;

    }


    .tools-grid {

        grid-template-columns:
            1fr;

    }

     .content-table th,
    .content-table td {

        padding:
            10px 16px;

        font-size:
            14px;

    }
}