/* ==========================
   1️⃣ Imports & Reset
   ========================== */
@import './reset.css';

/* ==========================
   2️⃣ Layout – .container
   ========================== */
.container {
    max-width: 1200px;          /* Admin page width overrides earlier 800px */
    margin: 0 auto;
    padding: 20px;
}

/* ==========================
   3️⃣ Typography & Buttons
   ========================== */
header { margin-bottom: 30px; text-align: center; }

h1 {
    font-size: 2.5rem;
    color:#222;
}

.btn,
button, /* allow native button styling if needed */
input[type="submit"]{
    display:inline-block;
    padding:.6rem 1.2rem;
    background:#0066cc;
    color:white;
    border:none;
    border-radius:4px;
    cursor:pointer;
    transition:background .3s;
}
.btn:hover{ background:#005bb5; }

.btn.secondary {
    background:#eee;
    color:#333;
}

/* ==========================
   4️⃣ Forms
   ========================== */
input, select, textarea{
    width:100%;
    padding:.5rem;
    margin-bottom:10px;
    border:1px solid #ccc;
    border-radius:4px;
}
label{
    display:block;
    font-weight:bold;
    margin-top:15px;
}

/* ==========================
   5️⃣ Calendar Table
   ========================== */
.calendar {
    width:100%;
    max-width:90%;            /* keeps table within viewport */
    margin:0 auto;
    border-collapse:collapse; /* removes gaps between borders */
}

.calendar th,
.calendar td{
    text-align:center;
    vertical-align:top;       /* keep day numbers at top of cell */
}

/* Header cells – light blue background + thin line */
.calendar th {
    background:#0066cc;
    color:white;
    padding:.4rem .6rem;
    font-weight:600;
    border:1px solid #ddd;
}

/* Body cells – grid lines, padding, font-size */
.calendar td{
    border:1px solid #e0e0e0; /* light gray for grid lines */
    padding:.9rem;
    min-width:50px;
    font-size:1.15rem;
}

.calendar .today{ background:#0ba4ca; }

/* Hover shading on entire row */
.calendar tbody tr:hover > td{
    background:#fafafa;
}

/* ==========================
   6️⃣ Calendar Tooltip
   ========================== */
.calendar-tooltip{
    position:relative;
    display:inline-block;
    text-align:left;          /* ensures the cell content is left aligned */
    cursor:pointer;
}

.tooltip-box{
    visibility:hidden;
    opacity:0;
    min-width:120px;
    max-width:90vw;           /* never exceed 90% of viewport */
    background:#fff;
    border:1px solid #ddd;
    padding:.6rem .8rem;
    border-radius:.3rem;
    box-shadow:0 2px 5px rgba(0,0,0,.15);
    position:absolute;
    top:100%;                 /* below the cell */
    left:50%;
    transform:translateX(-50%);
    z-index:10;
    transition:opacity .2s ease-in-out,visibility .2s;
}

.calendar-tooltip:hover .tooltip-box{
    visibility:visible;
    opacity:1;
}

/* Lines inside tooltip */
.tooltip-line{
    display:flex;
    align-items:center;
    margin-bottom:.15rem;
}
.tooltip-line:last-child{margin-bottom:0;}

/* Small coloured dot before each activity name */
.activity-dot{
    width:.8rem;height:.8rem;
    border-radius:50%;
    display:inline-block;
    margin-right:.3rem;
}

/* ==========================
   7️⃣ Weekly Summary
   ========================== */
.weekly-summary{
    margin-top:1rem;
    padding:.5rem 0;
    border-top:1px solid #ddd;
}
.week-row{
    display:flex;
    gap:.8rem;
    align-items:center;
    padding:5px;
    border-bottom:1px solid #eee;
}
.week-row strong{
    display:block;
    font-size:1.1em;
}
.week-row div{display:block;margin:2px 0;}
.activity-item{
    display:flex;            /* overrides later block declaration */
    align-items:center;
    gap:.3rem;
}
.week-total{
    color:#555;
}
/* Put this near the bottom of style.css, after .week-row */
.week-row > .summary-line {
    display: flex;          /* make it a flex container */
    align-items: center;    /* vertical alignment */
    margin-left: 1.5rem;    /* keep the same left‑margin you already use */
}

/* Put this in style.css – after all existing .summary-line rules */
/* Summary line – keep everything left‑aligned, but bottom‑align all items */
.summary-line {
    display: flex;
    align-items: flex-end;   /* ← this pushes every child to the bottom of the line */
    gap: 0.4rem;             /* optional space between dot, label and duration */
}

.summary-total {
    font-weight: 600;
}

/* Force proper block display for weekly summary (if you want nested styling) */
#weekly-summary .week-row{display:block;margin-bottom:15px;}
#weekly-summary .activity-item,
#weekly-summary .week-total{
    display:block;
    margin-left:1.5rem;
    margin:2px 0;
}

/* ==========================
   8️⃣ Admin Page Tables
   ========================== */
/* Make the table use 100% of the modal’s width */
.admin-table{
    width:100%;
}

/* Ensure text doesn’t overflow and wrap nicely */
.admin-table td,
.admin-table th{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.admin-table th{background:#f2f2f2;font-weight:bold;}
.admin-table .remove-member-btn{
    padding:.25rem .5rem;
    font-size:0.85rem;
}
@media (max-width:480px){
  .modal-content{
    padding:.75rem;          /* less padding */
    min-width:auto;          /* let it shrink */
  }
}

/* ==========================
   9️⃣ Organization Grid
   ========================== */
.org-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
    gap:20px;
    margin:20px 0;
}
.org-card{
    border:1px solid #ddd;
    border-radius:8px;
    padding:15px;
    background:#f9f9f9;
}
.org-actions{margin:15px 0;}
.org-actions input{
    padding:8px;
    margin-right:10px;
    width:70%;
}
.org-actions button{padding:8px 15px;}

#admin-link{
    margin-top:10px;
    text-align:right;
}

/* ==========================
   🔀 Responsive Adjustments
   ========================== */
@media (max-width:768px){
    .org-grid{grid-template-columns:1fr;}
    .admin-table{font-size:.9em;}
    .admin-table th,
    .admin-table td{padding:8px 4px;}
}

/* ==========================
   🎯 Modal
   ========================== */
.modal{
    position:fixed;
    inset:0; /* top/right/bottom/left = 0 */
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,.4);
    z-index:1000;
}
.hidden{display:none;}
/* NEW – replace .modal-content block */
.modal-content{
    background:#fff;
    padding:1.5rem;
    border-radius:.3rem;
    max-width:90vw;          /* take up most of the viewport width on small screens */
    min-width: 260px;        /* but never get smaller than this */
    width:auto;              /* let content decide the real width */
    box-shadow:0 2px 8px rgba(0,0,0,.3);
    max-height:80vh;          /* leave room for header/footer */
    overflow-y:auto;         /* scroll when needed */
}
.modal-actions{
    margin-top:1rem;
    text-align:right;
}

/* ==========================
   🎈 Activity Card
   ========================== */
.activity{
    margin-bottom:10px;
    background:#e3f2fd;
    border-left:4px solid #2196F3;
    padding:.5rem 1rem;
}

.login-banner {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 30px;
}

.login-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.status-message {
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hidden {
    display: none !important;
}

/* 1️⃣ Calendar dates – hand cursor */
.calendar td[data-date] {
    cursor: pointer;          /* hand icon on hover */
}

/* Calendar navigation */
#calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.nav-arrow { padding: 0.4rem 0.6rem; }
.small-nav-btn { font-size: 0.85rem; }
.btn.tiny {
    padding: .2rem .4rem;
    font-size:.8rem;
    margin-left:.3rem;
}

/* Increase width & padding */
.tooltip-box{
    min-width:260px;          /* enough room for several activities */
    max-width:90vw;           /* still responsive on very small screens */
    padding:1rem 1.2rem;      /* more space around the content */
    font-size:0.9rem;         /* slightly larger text, easier to read */
}

/* Keep the arrow‑style positioning but make it a little higher
   so it doesn’t overlap the cell’s number */
.tooltip-box{
    top:calc(100% + 4px);     /* add a small gap */
}

/* ------------- Tooltip line styling -------------- */
.tooltip-line{
    display:flex;
    align-items:center;          /* vertically centre dot, name & icons */
    white-space:nowrap;          /* keep whole line in one row */
    gap:.25rem;                  /* space between dot, name and buttons */

    /* Optional – if you want the name to truncate with ellipsis when too long */
    overflow:hidden;
    text-overflow:ellipsis;
}

/* ------------------------------------------------------------------
   🎯 Calendar Navigation Layout – Final Version
------------------------------------------------------------------ */

/* Wrapper that contains both Today & the centered nav */
#nav-row {
    display: flex;
    align-items: center;            /* vertical centering for all items */
    gap: 0.5rem;                    /* space between button and nav */
    margin-bottom: 1rem;            /* space below the row */
}

/* The “Today” button – left‑aligned & smaller */
#today-btn {
    padding: .25rem .45rem;
    font-size: .85rem;
    flex-shrink: 0;                 /* never stretch */
}

/* Centered navigation container */
.centered-nav {
    margin-left: auto;
    margin-right: auto;              /* centers inside #nav-row */
    display: flex;
    align-items: center;
    gap: .8rem;
}

/* Month/Year label styling (optional tweaks) */
#month-year-label {
    font-weight: bold;
    margin: 0 .3rem;
}

/* Navigation arrows – keep size consistent */
.nav-arrow {
    padding: .35rem .55rem;
    font-size: .95rem;
}

/* Responsive tweak for small screens */
@media (max-width:768px) {
    #nav-row {
        flex-direction: column;      /* stack Today and nav vertically on mobile */
        gap: .4rem;
    }

    .centered-nav {
        margin-left: 0;
        margin-right: 0;
        justify-content: center;
    }

    #today-btn {
        padding: .2rem .4rem;
        font-size: .8rem;
    }
}
