/*
==========================================================
Camp Somerset Workshop Management Suite
Version 2
Application Styles
==========================================================
*/

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{

    font-family:Segoe UI,Arial,sans-serif;
    background:#eef2f6;
    color:#2c3e50;
    line-height:1.5;

}

.application{

    max-width:1400px;
    margin:30px auto;
    padding:20px;

}

.application__header{

    background:#1f4e79;
    color:white;
    border-radius:12px;
    padding:30px;
    margin-bottom:25px;
    text-align:center;
    box-shadow:0 10px 30px rgba(0,0,0,.15);

}

.application__header h1{

    font-size:2rem;
    margin-bottom:10px;

}

.application__header p{

    opacity:.9;
    margin-top:4px;

}

/*==========================================================
Dashboard
==========================================================*/

.dashboard{

    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:20px;

}

.dashboard-card{

    background:white;
    border-radius:12px;
    padding:25px;
    cursor:pointer;
    transition:.25s;
    box-shadow:0 5px 15px rgba(0,0,0,.08);

}

.dashboard-card:hover{

    transform:translateY(-5px);
    box-shadow:0 15px 35px rgba(0,0,0,.18);

}

.dashboard-card h2{

    margin-bottom:12px;
    color:#1f4e79;

}

.dashboard-card-primary{

    background:#1f4e79;
    color:white;
    min-height:180px;

}

.dashboard-card-primary h2{

    color:white;
    font-size:1.8rem;
    margin-bottom:20px;

}

.dashboard-card-primary:hover{

    background:#286090;

}

/*==========================================================
Pages
==========================================================*/

.inventory-page{

    background:white;
    padding:25px;
    border-radius:12px;
    box-shadow:0 5px 15px rgba(0,0,0,.08);

}

.page-header{

    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;

}

.page-header h2{

    color:#1f4e79;

}

.page-toolbar{

    display:flex;
    gap:15px;
    margin-bottom:20px;
    flex-wrap:wrap;

}

/*==========================================================
Forms
==========================================================*/

input,
select,
textarea{

    width:100%;
    padding:12px;
    border:1px solid #cfd8dc;
    border-radius:8px;
    font-size:15px;
    margin-top:6px;
    margin-bottom:18px;

}

input:focus,
select:focus,
textarea:focus{

    outline:none;
    border-color:#1f4e79;
    box-shadow:0 0 0 3px rgba(31,78,121,.15);

}

textarea{

    resize:vertical;

}

label{

    font-weight:600;

}

/*==========================================================
Buttons
==========================================================*/

button{

    cursor:pointer;
    border:2px solid #1f4e79;
    border-radius:8px;
    background:#1f4e79;
    color:white;
    padding:11px 18px;
    font:inherit;
    font-weight:600;
    line-height:1.2;
    box-shadow:0 2px 4px rgba(31,78,121,.18);
    transition:background .2s,border-color .2s,box-shadow .2s,transform .2s;

}


/* ==========================================================
   GOOGLE SIGN-IN
========================================================== */

.sign-in-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #eef5f8;
}

/* The sign-in and loading layer must fully disappear once access is ready. */
.sign-in-gate[hidden] {
    display: none;
}

.sign-in-panel {
    width: min(100%, 430px);
    padding: 34px 28px;
    text-align: center;
    border: 1px solid #d4e1e7;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(18, 68, 95, 0.16);
}

.sign-in-panel .application-logo {
    max-width: 210px;
    margin: 0 auto 22px;
}

.sign-in-panel h1 {
    margin: 0 0 12px;
}

.sign-in-panel p {
    margin: 0 0 22px;
}

.sign-in-panel button {
    width: 100%;
}

.sign-in-loading {
    pointer-events: none;
}

.sign-in-spinner {
    display: block;
    width: 42px;
    height: 42px;
    margin: 6px auto 20px;
    border: 5px solid #d7e6ed;
    border-top-color: #176c9a;
    border-radius: 50%;
    animation: activity-spin .75s linear infinite;
}

.sign-in-loading h1 {
    font-size: 1.35rem;
}

.sign-in-message {
    min-height: 1.4em;
    margin: 16px 0 0 !important;
    color: #a12626;
    font-size: 0.9rem;
}

.application-logo{

    display:block;
    width:min(300px, 82%);
    height:auto;
    margin:0 auto 12px;
    border-radius:8px;

}

.screen-navigation{

    display:flex;
    justify-content:flex-start;
    margin-bottom:20px;

}

.unlisted-tool-help{

    margin:-5px 0 20px;
    padding:12px 14px;
    border-left:4px solid #1f4e79;
    border-radius:6px;
    background:#eef5fb;

}

button:hover{

    background:#163d5d;
    border-color:#163d5d;
    box-shadow:0 4px 9px rgba(31,78,121,.28);
    transform:translateY(-1px);

}

button:focus-visible{

    outline:3px solid rgba(31,78,121,.35);
    outline-offset:3px;

}

button:disabled{

    cursor:not-allowed;
    pointer-events:none;
    opacity:.55;
    box-shadow:none;

}

.btn-primary{

    background:#1f4e79;
    color:white;
    padding:12px 22px;
    border-radius:8px;
    font-weight:600;

}

.btn-primary:hover{

    background:#163d5d;

}

.btn-secondary{

    background:#757575;
    border-color:#757575;
    color:white;
    padding:12px 22px;
    border-radius:8px;

}

.btn-secondary:hover{

    background:#616161;

}

/* Keep every route back to the main dashboard visually consistent. */
#dashboardButton,
#loansBackButton,
#usersBackButton{

    background:#1f4e79;
    border-color:#1f4e79;

}

#dashboardButton:hover,
#loansBackButton:hover,
#usersBackButton:hover{

    background:#163d5d;
    border-color:#163d5d;

}

.btn-small{

    padding:7px 12px;
    margin-right:6px;
    border-radius:6px;
    background:#1f4e79;
    color:white;
    font-size:13px;

}

.btn-small:hover{

    background:#163d5d;

}

/*==========================================================
Tables
==========================================================*/

.inventory-table{

    width:100%;
    border-collapse:collapse;
    margin-top:20px;

}

.inventory-table th{

    background:#1f4e79;
    color:white;
    text-align:left;
    padding:12px;

}

.inventory-table td{

    padding:12px;
    border-bottom:1px solid #e0e0e0;

}

.inventory-table tr:hover{

    background:#f5f8fb;

}

/*==========================================================
Status Badges
==========================================================*/

.status{

    display:inline-block;
    padding:5px 12px;
    border-radius:20px;
    font-size:13px;
    font-weight:bold;

}

.status-available{

    background:#d4edda;
    color:#155724;

}

.status-on-loan{

    background:#fff3cd;
    color:#856404;

}

.status-maintenance{

    background:#f8d7da;
    color:#721c24;

}

/*==========================================================
Borrow / Return / Maintenance Cards
==========================================================*/

.tool-list{

    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:15px;

}

.borrow-tool-card,
.return-tool-card,
.maintenanceToolCard{

    background:white;
    border:2px solid #d9e3ec;
    border-radius:10px;
    padding:18px;
    cursor:pointer;
    transition:.2s;

}

.borrow-tool-card:hover,
.return-tool-card:hover,
.maintenanceToolCard:hover{

    border-color:#1f4e79;
    background:#eef5fb;

}

/*==========================================================
Section Titles
==========================================================*/

h3{

    color:#1f4e79;
    margin:20px 0 15px;

}

hr{

    margin:30px 0;
    border:none;
    border-top:1px solid #e0e0e0;

}

/*==========================================================
Responsive
==========================================================*/

@media(max-width:768px){

    .page-header{

        flex-direction:column;
        align-items:flex-start;
        gap:15px;

    }

    .page-toolbar{

        flex-direction:column;

    }

    .dashboard{

        grid-template-columns:1fr;

    }

    .inventory-table{

        display:block;
        overflow-x:auto;

    }

}
/*==========================================================
Return Condition Buttons
==========================================================*/

.condition-buttons{

    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:12px;
    margin-top:15px;

}

.condition-button{

    padding:14px;
    border:2px solid #176c9a;
    border-radius:8px;
    background:#176c9a;
    color:#ffffff;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    transition:all .2s ease;

}

.condition-button:hover{

    border-color:#0f4f73;
    background:#0f4f73;

}

.condition-button.selected{

    background:#1f4e79;
    color:#ffffff;
    border-color:#163d5d;
    box-shadow:0 4px 12px rgba(0,0,0,.15);
    transform:translateY(-2px);

}

.condition-button.excellent.selected{

    background:#2e7d32;
    border-color:#1b5e20;

}

.condition-button.good.selected{

    background:#1976d2;
    border-color:#0d47a1;

}

.condition-button.fair.selected{

    background:#f57c00;
    border-color:#e65100;

}

.condition-button.damaged.selected{

    background:#c62828;
    border-color:#8e0000;

}
/* ==========================================================
   Borrow Tool Selection
   ========================================================== */

.tool-result {
    background: #ffffff;
    border: 2px solid #d9e3ec;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all .2s ease;
}

.tool-result:hover {
    border-color: #1f4e79;
    background: #eef5fb;
    box-shadow: 0 5px 15px rgba(31,78,121,.18);
    transform: translateY(-2px);
}

.tool-result:active {
    transform: translateY(0);
}

.module-actions{

    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin:20px 0 25px;

}

.selected-loan-tool {
    padding: 14px;
    border: 2px solid #1f4e79;
    border-radius: 8px;
    background: #eef5fb;
    color: #173f5f;
}

/*==========================================================
Background Activity Indicator
==========================================================*/

#activityIndicator {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #173f5f;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 20px);
    transition: opacity .2s ease, transform .2s ease;
}

#activityIndicator.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.activity-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, .32);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: activity-spin .75s linear infinite;
}

@keyframes activity-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    #activityIndicator {
        bottom: 16px;
    }
}
