/* resources/styles.css */

/* --- SITE-WIDE LAYOUT --- */
body {
    font-family: 'Open Sans', Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Pushes the footer to the bottom of the screen */
}

h1, h2, h3, nav a, header a {
    font-family: 'Montserrat', Arial, sans-serif;
}

/* --- HEADER & NAVIGATION --- */
header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header a{
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.header-left h1 {
    margin-bottom: 10px;
    /* Adjust this number to match exactly where you want the line */
}

nav ul {
    list-style-type: none;
    font-size: 0.98em;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    /* Flexbox spacing between links */
}

nav a {
    text-decoration: none;
    color: #00539C;
    font-weight: bold;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

nav a:hover {
    text-decoration: none;
    border-bottom-color: #00539C;
}

nav a.active {
    color: #003b73;
    border-bottom-color: #00539C;
}

/* --- MAIN CONTENT CONTAINER --- */
main {
    background-color: #fff;
    max-width: 850px;
    width: 100%;
    margin: 50px auto;
    padding: 50px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
    /* Instructs the main container to fill available vertical space */
    box-sizing: border-box;
}

/* --- TYPOGRAPHY --- */
h1 {
    margin-top: 0;
    margin-bottom: 5px;
}

h2 {
    color: #00539C;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-top: 30px;
}

main a {
    color: #00539C;
    text-decoration: none;
}

main a:hover {
    text-decoration: underline;
}

ul {
    margin-left: 20px;
}

code {
    background-color: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: Consolas, Monaco, monospace;
}

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

/* --- CONTACT SECTION --- */
.contact-card {
    background-color: #fdfdfd;
    border-left: 5px solid #00539C;
    padding: 20px 30px;
    border-radius: 6px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.contact-info-block h3 {
    margin-top: 0;
    color: #00539C;
    margin-bottom: 8px;
}

.contact-info-block p {
    margin: 5px 0;
    font-size: 0.95em;
}

.btn-download {
    display: inline-block;
    background-color: #00539C;
    color: #fff;
    padding: 10px 18px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-download:hover {
    background-color: #003b73;
    text-decoration: none;
}

/* --- PROJECT CARDS --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.project-card {
    background-color: #fdfdfd;
    border: 1px solid #eaeaea;
    padding: 25px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.project-card h3 {
    margin-top: 0;
    color: #00539C;
    font-size: 1.15em;
    margin-bottom: 10px;
}

.project-card p {
    margin: 0;
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.project-tag {
    display: inline-block;
    margin-top: 14px;
    padding: 3px 8px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #00539C;
    background-color: #e6f0fa;
    border-radius: 4px;
}

.loading-msg, .error-msg {
    grid-column: 1 / -1;
    font-size: 1em;
    color: #666;
    padding: 15px 0;
}

.error-msg {
    color: #d9534f;
}

/* --- WEATHER CARD --- */
.weather-card {
    background-color: #fdfdfd;
    border: 1px solid #eaeaea;
    border-left: 5px solid #00539C;
    padding: 22px 28px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.weather-header h3 {
    margin: 0 0 4px 0;
    color: #00539C;
    font-size: 1.15em;
}

.weather-summary {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
}

.weather-temp-badge {
    background-color: #e6f0fa;
    color: #00539C;
    font-size: 1.5em;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    white-space: nowrap;
}

.weather-details {
    margin: 0;
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
}

/* Animation & Extended Forecast */
.weather-fade-in {
    animation: weatherFadeIn 0.6s ease-out forwards;
}

@keyframes weatherFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.forecast-toggle-btn {
    background-color: transparent;
    color: #00539C;
    border: 1px solid #00539C;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-family: inherit;
}

.forecast-toggle-btn:hover {
    background-color: #00539C;
    color: #fff;
}

.extended-forecast {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
    margin-top: 0;
}

.extended-forecast.is-open {
    max-height: 500px;
    opacity: 1;
    margin-top: 18px;
}

.extended-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.extended-card {
    background-color: #f7f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 12px 14px;
}

.extended-card h4 {
    margin: 0 0 6px 0;
    font-size: 0.9em;
    color: #00539C;
}

.extended-temp {
    display: inline-block;
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.extended-card p {
    margin: 0;
    font-size: 0.85em;
    color: #666;
    line-height: 1.4;
}

/* --- RESUME STYLING --- */
.contact-info {
    color: #555;
    font-size: 1em;
    margin-bottom: 20px;
}

.item {
    margin-bottom: 15px;
}

.item-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    margin-bottom: 15px;
    gap: 10px;
}

.item-main {
    font-size: 0.98em;
}

.item-date {
    color: #666;
    font-size: 0.98em;
    text-align: right;
    min-width: 110px;
    margin-left: 10px;
    white-space: nowrap;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 20px;
    color: #555;
    font-size: 0.9em;
}

/* --- AUTOMATIC DARK MODE --- */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }

    header, main, .contact-card, .project-card, .weather-card {
        background-color: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .weather-card {
        border-color: #333;
        border-left-color: #66b2ff;
    }

    .weather-header h3 {
        color: #66b2ff;
    }

    .weather-summary {
        color: #e0e0e0;
    }

    .weather-temp-badge {
        background-color: #1a2a3a;
        color: #66b2ff;
    }

    .weather-details {
        color: #aaa;
    }

    .forecast-toggle-btn {
        color: #66b2ff;
        border-color: #66b2ff;
    }

    .forecast-toggle-btn:hover {
        background-color: #66b2ff;
        color: #121212;
    }

    .extended-card {
        background-color: #252525;
        border-color: #383838;
    }

    .extended-card h4 {
        color: #66b2ff;
    }

    .extended-temp {
        color: #e0e0e0;
    }

    .extended-card p {
        color: #aaa;
    }

    .project-card {
        border-color: #333;
    }

    .project-card:hover {
        border-color: #66b2ff;
        box-shadow: 0 8px 15px rgba(0,0,0,0.8);
    }

    .project-tag {
        color: #66b2ff;
        background-color: #1a2a3a;
    }

    .loading-msg {
        color: #aaa;
    }

    .error-msg {
        color: #ff6b6b;
    }

    .contact-card {
        border-left-color: #66b2ff;
    }

    .project-card p, .contact-info, .item-date {
        color: #aaa;
    }

    header a {
        color: #e0e0e0;
    }

    nav a, main a, h2, .contact-info-block h3, .project-card h3 {
        color: #66b2ff;
    }

    nav a:hover, nav a.active {
        color: #66b2ff;
        border-bottom-color: #66b2ff;
    }

    h2 {
        border-bottom: 1px solid #333;
    }

    .btn-download {
        background-color: #66b2ff;
        color: #121212;
    }

    .btn-download:hover {
        background-color: #4fa3e3;
    }

    footer {
        color: #aaa;
    }

    code {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }
}

/* --- RESPONSIVE LAYOUT --- */
@media (max-width: 600px) {
    header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 15px;
    }

    main {
        padding: 30px 20px;
        margin: 20px auto;
    }

    .item-grid {
        grid-template-columns: 1fr;
    }

    .item-date {
        text-align: left;
        margin-left: 0;
    }
}

/* --- ACCESSIBILITY: VISIBLE FOCUS STATES --- */
a:focus, button:focus, .btn-download:focus, .project-card:focus {
    outline: 3px solid #00539C;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Update dark mode focus outline */
@media (prefers-color-scheme: dark) {
    a:focus, button:focus, .btn-download:focus, .project-card:focus {
        outline: 3px solid #66b2ff;
    }
}
