/* style.css */
/* https://visme.co/blog/website-color-schemes/ */
/* Color scheme */

/*-------------------Settings START--------------------*/
* {
    box-sizing: border-box;
}

:root {
    /* Primary Palette */
    --color-brown-dark: #4C301F;
    --color-brown-medium: rgba(76,48,31,.5);
    --color-cream: #F8F2DC;
    
    /* Accent 1: Blue/Teal for Index/Links */
    --color-teal-dark: #0063a1;
    --color-teal-medium: #BDD0D2;
    --color-teal-hover: #4B86AA;
    --color-teal-bg: rgba(75,134,170, .85);
    --color-teal-bg-hover: rgba(75,134,170, 1);

    /* Accent 2: Red/Orange for Button/Bottom Content */
    --color-red-dark: #CD4631;
    --color-orange-light: #ffc6af;
    --color-red-bg: rgba(205,70,49, .85);
}

.visually-hidden { /* For accessible labels that are visually hidden */
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

header, footer {
    background-color: var(--color-brown-medium);
    color: var(--color-cream);
    padding: 20px;
    text-align: center;
    font-size: 1.3em;
}

header p {
    margin: 0;
}

header h1 {
    margin-bottom: 0;
}

main {
    padding: 10px;
}

/*------------------Media Settings START----------------*/
@media only screen and (max-width: 870px) {
    /* General layout adjustments for medium/small screens */
    body {
        font-size: 0.8em;
    }

    #main-container {
        flex-direction: column;
        align-items: center;
    }

    #left-content {
        max-width: 100%;
        margin-bottom: 2.5px;
    }

    #right-content {
        max-width: 350px;
        width: 100%;
        margin-top: 2.5px;
    }

    /* Map settings */
    #matrix-container {
        flex-direction: column;
    }

    #birthdateMatrixContainer, #combinedMartixContainer {
        width: 100%;
        margin: 10px 0;
    }
    
    #cmt1, #cmt2 {
        padding-left: 10px;
    }

    /* Personal months settings */
    #personalMonthLegend {
        max-width: 300px;
    }

    /* Personal days settings */
    .personal-day-calendar {
        max-width: 95%;
        gap: 3px;
        padding: 5px;
    }

    .personal-day-calendar .day-header {
        font-size: 0.75rem;
        padding: 5px 0;
    }

    .personal-day-calendar .day-cell {
        border-width: 1.5px;
        padding-top: 2px;
    }

    /* ↓ Adjusted for readability but still compact */
    .personal-day-calendar .personal-day {
        opacity: 0;
        visibility: hidden;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 1.1rem;
        font-weight: 800;
        color: var(--color-red-dark);
        background-color: rgba(255, 255, 255, 0.9);
        padding: 4px 8px;
        border-radius: 6px;
        transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
        pointer-events: none;
        z-index: 5;
    }

    .personal-day-calendar .day-number {
        font-size: 1rem;
        font-weight: 700;
        color: var(--color-brown-dark);
        opacity: 1;
        transition: opacity 0.2s ease-in-out;
    }

    .personal-day-calendar .day-cell:hover .personal-day {
        opacity: 1;
        visibility: visible;
    }

    .personal-day-calendar .day-cell:hover .day-number {
        opacity: 0.25;
    }

    /* ↓ Align the title/header to the left instead of center */
    #personalCalendar h3 {
        text-align: left !important;
        margin-left: 10px;
        font-size: 1rem;
    }
}

@media only screen and (max-width: 550px) {
    /* Smaller phones */
    body {
        font-size: 0.7em;
    }

    #right-content {
        display: none;
    }

    /* Personal days settings */
    .personal-day-calendar {
        gap: 2px;
        padding: 3px;
    }

    .personal-day-calendar .personal-day {
        font-size: 1rem;
        padding: 3px 6px;
    }

    .personal-day-calendar .day-number {
        font-size: 0.9rem;
    }

    #personalCalendar h3 {
        font-size: 0.85rem;
        margin-left: 5px;
    }
}
/*------------------Media Settings END----------------*/

/*-------------------Settings END--------------------*/

/*-----------------Main container START-----------------*/
#main-container {
    display: flex;
}

/*-----------------Left content START-------------------*/
#left-content {
    flex: 1;
    min-width: 250px;
    max-width: 340px;
}

#input-container {
    background-color: var(--color-brown-medium);
    padding: 5px;
    text-align: center;
    border-radius: 10px;
}

#name, #birthdate {
    border-bottom-width: 0;
}

input[type="text"] {
    background-color: var(--color-cream);
    color: #000000;
    border-width: 3px solid var(--color-red-dark);;
    width: 100%;
    padding: 5px;
    margin-right: 5px;
}

/* input[type="text"], #calculateBtn {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
} */

#calculateBtn {
    background-color: var(--color-orange-light);
    color: var(--color-red-dark);
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
    border: none;
    padding: 5px 10px;
    margin: 5px 0 0 0;
    font-size: 1.0rem;
}

#calculateBtn:hover {
    background-color: var(--color-red-dark);
    color: var(--color-cream);
}

/*-------------Basic Info Container START---------------*/
#basicInfo-container {
    background-color: var(--color-brown-medium);
    color: var(--color-cream);
    text-align: justify;
    margin: 5px 0;
    border-radius: 10px;
}

#basicInfo-container p {
    margin: 5px 0;
    padding-left: 10px;
}
/*-------------Basic Info Container END----------------*/

/*---------------Index container START-----------------*/
#index-container {
    background-color: rgba(248, 242, 220, .5);
    text-align: justify;
    padding: 5px;
    border-radius: 10px;
}

#index-container h2 {
    color: rgba(248, 242, 220, 1);
    text-align: center;
    margin: 5px 0;
}

#index-container p {
    background-color: #BDD0D2;
    color: #0063a1;
    cursor: pointer;
    padding: 5px 10px;
    margin: 5px;
    transition: background-color 0.3s;
    font-weight: 700;
}

#index-container p:hover { 
    background-color: #4B86AA;
    color: var(--color-cream);
}
/*---------------Index container END-----------------*/

#yourmapBtn {
    text-align: center;
}
/*-----------------Left content END-------------------*/

/*------------------Right content START---------------*/
#right-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

#rightHead {
    text-align: center;
    color: var(--color-cream);
}

#dropdown {
    text-align: justify;
    max-height: 0; /* Start collapsed */
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#dropdown.open {
    max-height: 500px;
}

#upperright {
    background-color: rgba(75,134,170, .85);
    color: var(--color-cream);
    text-align: justify;
    padding: 10px;
    margin: 5px;
    margin-top: 0;
    margin-bottom: 2.5px;
    border-radius: 10px;
    cursor: pointer;
}

#upperright:hover {
    background-color: var(--color-teal-bg-hover);
}

#upperright h2 {
    margin: 0;
}

#upperright p {
    margin: 10px;
}

#bottomright {
    background-color: var(--color-red-bg);
    color: var(--color-cream);
    flex: 1;
    text-align: justify;
    padding: 10px;
    margin: 5px;
    margin-bottom: 0;
    margin-top: 2.5px;
    border-radius: 10px;
}

#bottomright h2 {
    margin: 0;
}

#bottomright p {
    margin-bottom: 10px;
}
/*------------------Right content END---------------*/

/*-------------Personal Year Calendar START----------*/
#personalCalendar {
    margin-top: 20px;
    /* text-align: center; */
    color: var(--color-cream);
}

/* Styles for the ONLY structure used now: #personalYearList (the cards) */
#personalYearList {
    display: flex;
    flex-direction: column;
    gap: 0px !important; /* Eliminate gap between cards for seamless look */
    padding: 0 10px 10px 10px; /* Adjust padding to match the card structure */
    margin-top: 0px !important; /* Remove top margin so it butts up against the header */
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0 0 5px 5px; /* Keep bottom border radius only */
}

/* Update the first month card to visually connect to the legend header */
#personalYearList .personal-month-card:first-child {
    border-top: none !important; /* Remove top border of the first month card */
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.personal-month-card {
    background-color: var(--color-cream);
    color: var(--color-red-dark);
    padding: 8px 15px;
    border: 1px solid var(--color-red-dark);
    border-radius: 5px;
    text-align: left;
    display: flex;
    justify-content: space-between; /* Pushes Month and Number to opposite sides */
    font-weight: bold;
}

.personal-month-card .month-number {
    font-weight: bold;
}

/* Highlighting the entire current month card */
.personal-month-card.current-month-row {
    background-color: var(--color-red-dark);
    color: var(--color-cream);
    border: 3px solid var(--color-orange-light);
}

/* Styling for the new Header/Legend Row */
#personalMonthLegend {
    /* Use a contrasting background color from your teal palette */
    background-color: var(--color-teal-dark) !important;
    color: var(--color-cream) !important;
    border: 1px solid var(--color-teal-dark) !important;
    font-weight: bold;
    text-transform: uppercase;
    /* Enforce Padding: This ensures the height is exactly the same as .personal-month-card */
    padding: 8px 10px !important; 
    /* Explicitly remove the bottom border to visually merge with the list below */
    border-bottom: none !important; 
    /* Keep top border radius, remove bottom radius */
    border-radius: 5px 5px 0 0 !important; 
    /* Remove any margin spacing */
    margin-bottom: 2px !important;
    width: 380px;
    margin-left: auto;
    margin-right: auto;
}

/* Ensure text inside the legend is clearly visible */
#personalMonthLegend .month-name, #personalMonthLegend .month-number {
    color: var(--color-cream);
}
/*-------------Personal Year Calendar END--------------*/
/*-----------Personal Month Calendar START-------------*/
.personal-day-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    max-width: 700px;
    margin: 25px auto;
    background-color: var(--color-cream);
    border: 4px solid var(--color-red-dark);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Day of week header row */
.personal-day-calendar .day-header {
    background-color: var(--color-teal-dark);
    color: var(--color-cream);
    font-weight: 700;
    text-align: center;
    padding: 10px 0;
    border-radius: 5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Day cell */
.personal-day-calendar .day-cell {
    display: flex;
    flex-direction: column; /* stack day number above personal number */
    justify-content: flex-start;
    align-items: center;
    background-color: var(--color-cream);
    color: var(--color-brown-dark);
    border: 2px solid var(--color-teal-medium);
    border-radius: 5px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    font-weight: 700;
    transition: background-color 0.2s, transform 0.1s;
    padding-top: 5px; /* space between top and numbers */
}

/* .personal-day-calendar .day-cell:hover {
    background-color: var(--color-orange-light);
    transform: scale(1.03);
} */

/* Day number (calendar date, small on top) */
.personal-day-calendar .day-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-brown-dark);
    margin-top: 2px;
}

/* Personal day number (large, below) */
.personal-day-calendar .personal-day {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-red-dark);
    margin-top: 4px;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

/* Highlight current day */
.personal-day-calendar .today {
    background-color: var(--color-cream);
    color: var(--color-cream);
    border: 3px solid var(--color-red-dark);
    box-shadow: 0 0 10px var(--color-red-dark);
    transform: scale(1.02);
}

/* Empty cells (before/after month) */
.personal-day-calendar .empty {
    background-color: rgba(248, 242, 220, 0.6);
    border: 1px solid var(--color-teal-medium);
    pointer-events: none;
}
/*---------------Personal Month Calendar END----------*/

/*------------------Main container END-----------------*/

/*----------------Language Container START--------------*/  
#language-container {
    position: absolute;
    top: 10px;
    right: 10px;
}

#language {
    background-color: var(--color-cream);
    color: var(--color-brown-dark);
    padding: 3px;
}
/*----------------Language Container END--------------*/  

/*-------------------Footer START-------------------*/
#contactInfo {
    margin-top: 0; /* Remove top margin */
    color: var(--color-cream);
}

#contactInfo h3 {
    margin-bottom: 10px;
}

#contactInfo p {
    margin: 5px 0;
}

a {
    color: #4B86AA;
}

a:hover {
    color: #d5e0e7
}
/*-------------------Footer END-------------------*/

/*------------------Matrix (Map) START--------------*/
#matrix-container {
    display: flex;
    justify-content: center;  /* Center children horizontally */
    align-items: center;      /* Center children vertically */
    margin-top: 20px;         /* Add some space at the top */
}

#birthdateMatrixContainer, #combinedMartixContainer {
    width: 250px;
    margin: 0 15%;
}

#birthdateMatrixContainer h3,
#combinedMartixContainer h3 {
    text-align: center;
    margin: 0;
}

#birthdateMatrixContainer table,
#combinedMartixContainer table {
    margin-top: 10px;
    border-collapse: collapse;
    width: 100%; /* Set table width to 100% */
    background-color: var(--color-cream);
    color: #000000;
}

#birthdateMatrixContainer th,
#combinedMartixContainer th {
    text-align: center; /* Center align header text */
    padding: 15px;
    border: 1px solid var(--color-red-dark);
}

#birthdateMatrixContainer td,
#combinedMartixContainer td {
    padding: 15px;
    border: 3px solid var(--color-red-dark);
    width: 35px;
    height: 35px;
    text-align: center;
    vertical-align: middle; /* Align cells vertically in the middle */
}

.birthdate-text {
    color: #4B86AA; /* Set the color for birthdate text */
}

.name-text {
    color: #000000; /* Set the color for name text */
}

#patternContainer {
    color: var(--color-cream);
}

#cmt1, #cmt2 {
    padding-left: 100px;
    margin: 0;
}
/*------------------Matrix (Map) END--------------*/

/*---------------Additional Settings START--------------*/
#bgv { /* Use the ID for the video element */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover; /* Ensures the video covers the entire viewport */
    z-index: -100;
    filter: blur(5px);
}
/*----------------Additional Settings END--------------*/