/* =============================================
   ONECAINTA - Announcements & Weather Styles
   ============================================= */

/* =============================================
   BASE & RESET
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-image: url("background.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* =============================================
   BUTTONS
   ============================================= */
.logout-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
}

.logout-btn:hover {
    background: #c0392b;
}

.home-btn {
    background: #2c7be5;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
}

.home-btn:hover {
    background: #e2e5e9;
}

/* =============================================
   CONTAINER
   ============================================= */
.container {
    width: 90%;
    max-width: 900px;
    margin: clamp(24px, 5vw, 50px) auto;
}

/* =============================================
   ANNOUNCEMENT CARD
   ============================================= */
.announcement {
    background: white;
    padding: clamp(14px, 3vw, 20px);
    margin-bottom: clamp(16px, 3vw, 28px);
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
    overflow: hidden;
    opacity: 1;
    transform: none;
}

.announcement h3 {
    margin-top: 0;
    color: black;
    margin-bottom: -10px;
    font-size: clamp(16px, 3vw, 20px);
    font-weight: 800;
}

.date {
    font-size: clamp(11px, 1.5vw, 13px);
    color: #5a6474;
    margin-bottom: 20px;
    font-weight: 500;
}

/* =============================================
   ANNOUNCEMENT IMAGE
   ============================================= */
.announcement-img {
    width: 100%;
    height: auto;          /* natural height, never cropped */
    object-fit: contain;   /* show full image */
    border-radius: 10px;
    margin-bottom: 30px;
    display: block;
    margin-left: 0;
}

/* =============================================
   ANNOUNCEMENT BODY TEXT
   ============================================= */
.announcement p {
    font-size: clamp(14px, 2vw, 17px);
    line-height: 1.78;
    color: black;
    margin-top: 12px;
    text-align: justify;
}

/* =============================================
   ANIMATION
   ============================================= */
.announcement.animate {
    animation: slideUp 0.6s ease both;
}

.announcement.reveal-pending {
    opacity: 0;
    transform: translateY(40px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   BREAKPOINTS
   ============================================= */

/* Tablet: 601px–900px */
@media (min-width: 601px) and (max-width: 900px) {
    .announcement-img {
        width: 85%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Desktop: 901px+ */
@media (min-width: 901px) {
    .container {
        width: 65%;
    }

    .announcement-img {
        width: 80%;
        height: auto;      /* always let height follow naturally */
        margin-left: auto;
        margin-right: auto;
    }
}

/* WEATHER */
.weather-section{
    width:min(90%,1100px);
    margin:35px auto;
    animation:slideUp .6s ease both;
}

.weather-section{
    background: rgba(255, 255, 255, 0.726);
    padding: clamp(14px, 3vw, 20px);
    margin-bottom: clamp(16px, 3vw, 28px);
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
    overflow: hidden;
    opacity: 1;
    transform: none;
}

.weather-section h2{
    color:black;
    font-size:28px;
    margin:0 0 12px;
    text-shadow:0 3px 8px rgba(0,0,0,.35);
}

.weather-container{
    display:flex;
    gap:20px;
    overflow-x:auto;
    scroll-behavior:smooth;
    scroll-snap-type:x mandatory;
    padding:10px 5px 20px;
}
.weather-container::-webkit-scrollbar{height:8px}
.weather-container::-webkit-scrollbar-thumb{
    background:#aab6c2;border-radius:20px;
}

.weather-card{
    background: linear-gradient(135deg,#4ba2ee,#00bcf0);
    color:white;
    border-radius:20px;
    padding:20px;
    min-width:170px;
    text-align:center;
    cursor:pointer;
    transition:.35s;
    box-shadow:0 8px 20px rgba(0,0,0,.18);
}

.weather-card:hover{

    transform:translateY(-8px) scale(1.03);
    background: linear-gradient(135deg,#4facfe,#00c6fb);
    box-shadow:0 15px 30px rgba(0,0,0,.25);

}

.weather-card.fade-in{
    animation:slideUp .6s ease backwards;
}

.weather-card h4{
    margin:0;
    color:#2c3e50;
    font-size:18px;
}
.weather-card p{
    margin:10px 0;
    color:#2c3e50;
}
.weather-card strong{
    color:#0b5ed7;
}

.weather-icon{

    font-size:60px;

    margin:15px 0;

    animation:float 2.5s infinite ease-in-out;

}

@keyframes float{

    0%{transform:translateY(0);}
    50%{transform:translateY(-10px);}
    100%{transform:translateY(0);}

}

/* LOADING */
.weather-card.loading{
    background:#eef2f6;
    position:relative;
    overflow:hidden;
}
.weather-card.loading>*{visibility:hidden}
.weather-card.loading::before{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(90deg,transparent,rgba(255,255,255,.85),transparent);
    transform:translateX(-100%);
    animation:shimmer 1.1s infinite;
}
@keyframes shimmer{
    to{transform:translateX(100%)}
}

/* RESPONSIVE */
@media(min-width:901px){
.container{width:65%}
.announcement-img{width:80%;display:block;margin:auto}
}
@media(min-width:601px) and (max-width:900px){
.announcement-img{width:85%;display:block;margin:auto}
}
@media(max-width:768px){
.weather-card{min-width:170px;padding:16px}
.weather-section h2{font-size:24px}
.weather-icon{font-size:44px}
}


.weather-modal{

    display:none;

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.55);

    backdrop-filter:blur(8px);

    justify-content:center;

    align-items:center;

    z-index:9999;

}

.weather-content{

    width:800px;

    max-width:92%;

    max-height:90vh;

    overflow:auto;

    background:white;

    border-radius:25px;

    padding:35px;

    animation:popup .35s ease;

}

#closeWeather{

    border:0;
    background:transparent;
    color:inherit;

    float:right;
    cursor:pointer;
    font-size:28px;
}

@keyframes popup{

    from{

        opacity:0;

        transform:scale(.8);

    }

    to{

        opacity:1;

        transform:scale(1);

    }

}

.hour-row{

    display:grid;

    grid-template-columns: 70px minmax(0, 1fr) 70px 90px;
    gap:12px;

    padding:12px;

    margin:8px 0;

    border-radius:12px;

    background:#f4f7fb;

    align-items:center;

    transition:.25s;

}

.hour-row:hover{

    background:#dfefff;

}

.weather-summary{

    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:15px;

    margin-bottom:25px;

}

.weather-summary p{

    background:#f7f7f7;

    padding:15px;

    border-radius:15px;

    font-size:17px;

}

.weather-advice{

    background:#e8f7ff;

    border-left:6px solid #2196F3;

    padding:18px;

    border-radius:12px;

    margin:25px 0;

    font-size:18px;

}

.weather-note, #weatherLocation { color:#526174; line-height:1.5; }
.daily-rain-chance { max-width:200px; margin-left:auto; margin-right:auto; }
.hour-header { font-weight:700; font-size:13px; background:#e8f7ff; }
.hour-condition { line-height:1.4; overflow-wrap:break-word; }
.weather-card:focus-visible, #closeWeather:focus-visible { outline:3px solid #183c75; outline-offset:3px; }

@media(max-width:520px){
    .weather-content { padding:20px 14px; }
    .hour-row { grid-template-columns:48px minmax(0, 1fr) 48px 62px; gap:6px; padding:10px 8px; font-size:12px; overflow-wrap:anywhere; }
    .hour-header { font-size:11px; }
    .weather-advice { padding:14px; font-size:16px; line-height:1.5; }
}

@media (prefers-reduced-motion: reduce) {
    .announcement.animate, .weather-section, .weather-card.fade-in,
    .weather-icon, .weather-card.loading::before, .weather-content {
        animation: none;
    }
    .announcement.reveal-pending { opacity:1; transform:none; }
    .weather-card { transition:none; }
    .weather-container { scroll-behavior:auto; }
}
