
/* ==========================================
   TIE DeKUT - RESOURCES PAGE REDESIGN
   Independent stylesheet
   Does not modify other pages
========================================== */

.resources-page {
    --resource-green: #075c46;
    --resource-dark: #073b30;
    --resource-emerald: #0b8061;
    --resource-light: #eaf5ef;
    --resource-text: #18352d;
    --resource-muted: #71827b;

    background: #f5f8f6;
    color: var(--resource-text);
    font-family: "Segoe UI", Arial, sans-serif;
}

/* Navigation */

.resources-page header {
    position: relative;
    z-index: 10;
    background: #fff;
    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.06);
}

.resources-page .navbar {
    max-width: 1250px;
    margin: auto;
    padding: 16px 5%;
}

.resources-page .logo {
    color: var(--resource-dark);
    font-weight: 800;
}

.resources-page .logo span {
    color: var(--resource-emerald);
}

.resources-page #navLinks a {
    transition: color 0.25s ease;
}

.resources-page #navLinks a:hover {
    color: var(--resource-emerald);
}

/* ==========================================
   HERO SECTION
========================================== */

.resources-page .page-header {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    min-height: 390px;
    padding: 110px 20px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;

    color: white;
    background: var(--resource-dark);
}

/* Rotating image backgrounds */

.resources-page .page-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    animation: resourceHeroSlides 25s infinite;
}

/* Dark overlay for readable text */

.resources-page .page-header::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;

    background: linear-gradient(
        110deg,
        rgba(2, 35, 27, 0.88),
        rgba(3, 76, 57, 0.65),
        rgba(0, 0, 0, 0.35)
    );
}

.resources-page .page-header h1 {
    max-width: 900px;
    margin: 0 0 16px;

    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    color: white;
}

.resources-page .page-header p {
    max-width: 650px;
    margin: 0;

    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

@keyframes resourceHeroSlides {
    0%, 18% {
        background-image: url("../assets/images/engineer.jpg");
    }

    20%, 38% {
        background-image: url("../assets/images/engineer%202.jpg");
    }

    40%, 58% {
        background-image: url("../assets/images/Cell-phone.webp");
    }

    60%, 78% {
        background-image: url("../assets/images/satelite.jpg");
    }

    80%, 98% {
        background-image: url("../assets/images/telecoms-masts-2000759.webp");
    }

    100% {
        background-image: url("../assets/images/engineer.jpg");
    }
}

/* ==========================================
   MAIN RESOURCES AREA
========================================== */

.resources-page main {
    min-height: 65vh;
}

.resources-page .resources-section {
    width: min(1200px, 92%);
    margin: 45px auto 75px;
}

/* Search and filter panel */

.resources-page .resource-tools {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) auto repeat(2, minmax(130px, 1fr)) auto;
    gap: 12px;

    padding: 22px;
    margin-bottom: 30px;

    background: white;
    border: 1px solid #e5eee8;
    border-radius: 18px;

    box-shadow: 0 8px 30px rgba(14, 66, 48, 0.07);
}

.resources-page input:not([type="checkbox"]),
.resources-page textarea,
.resources-page select {
    width: 100%;
    min-width: 0;

    padding: 13px 15px;

    border: 1px solid #dce7df;
    border-radius: 10px;

    background: #fbfdfb;
    color: var(--resource-text);

    font-family: inherit;
    font-size: 0.95rem;

    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.resources-page input:focus,
.resources-page textarea:focus,
.resources-page select:focus {
    border-color: var(--resource-emerald);
    box-shadow: 0 0 0 3px rgba(11, 128, 97, 0.12);
}

.resources-page button {
    cursor: pointer;
    font-family: inherit;
    transition: 0.25s ease;
}

.resources-page .resource-tools button {
    border: none;
    border-radius: 10px;
    padding: 12px 17px;

    background: var(--resource-green);
    color: white;
    font-weight: 700;
    white-space: nowrap;
}

.resources-page .resource-tools button:hover {
    background: var(--resource-dark);
    transform: translateY(-2px);
}

.resources-page #uploadResourceBtn {
    background: #e6f4ed;
    color: var(--resource-dark);
    border: 1px solid #cce8d9;
}

.resources-page #uploadResourceBtn:hover {
    background: var(--resource-green);
    color: white;
}

/* ==========================================
   UPLOAD PANEL
========================================== */

.resources-page .upload-form-container {
    max-width: 760px;
    margin: 0 auto 35px;
    padding: 30px;

    background: white;
    border: 1px solid #e3eee7;
    border-radius: 18px;

    box-shadow: 0 12px 35px rgba(14, 66, 48, 0.09);
}

.resources-page .upload-form-container.hidden {
    display: none !important;
}

.resources-page .upload-form-container h2 {
    margin: 0 0 24px;
    color: var(--resource-dark);
    font-size: 1.55rem;
}

.resources-page #resourceUploadForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resources-page #resourceUploadForm label {
    margin-top: 8px;
    color: var(--resource-dark);
    font-weight: 650;
}

.resources-page #resourceUploadForm p {
    color: var(--resource-muted);
    font-size: 0.9rem;
}

.resources-page #resourceUploadForm input[type="checkbox"] {
    width: auto;
    accent-color: var(--resource-emerald);
}

.resources-page #manualUnitFields {
    padding: 15px;
    margin-top: 8px;

    background: #f1f8f4;
    border-radius: 12px;
}

.resources-page .upload-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.resources-page .upload-buttons button {
    padding: 12px 20px;
    border: none;
    border-radius: 9px;

    background: var(--resource-green);
    color: white;
    font-weight: 700;
}

.resources-page .upload-buttons button:hover {
    background: var(--resource-dark);
}

.resources-page .upload-buttons button:last-child {
    background: #edf1ee;
    color: #354d43;
}

.resources-page #uploadStatus {
    min-height: 22px;
    margin-top: 8px;
    font-weight: 600;
}

/* ==========================================
   RESOURCE DISPLAY
========================================== */

.resources-page #resourcesList > h2,
.resources-page .other-resources-section > h2 {
    margin: 35px 0 20px;
    padding-bottom: 12px;

    color: var(--resource-dark);
    font-size: 1.65rem;

    border-bottom: 2px solid #dcebe2;
}

.resources-page .unit-resource-group {
    margin-bottom: 28px;
    padding: 22px;

    background: white;
    border: 1px solid #e5eee8;
    border-radius: 16px;

    box-shadow: 0 5px 20px rgba(14, 66, 48, 0.045);
}

.resources-page .unit-resource-group > h3 {
    margin: 0 0 18px;
    color: var(--resource-emerald);
    font-size: 1.12rem;
}

/* Individual resource cards */

.resources-page .resource-card {
    position: relative;
    margin: 12px 0;
    padding: 20px;

    background: #fbfdfb;
    border: 1px solid #e5eee8;
    border-left: 4px solid var(--resource-emerald);
    border-radius: 12px;

    transition: transform 0.25s, box-shadow 0.25s;
}

.resources-page .resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 22px rgba(14, 66, 48, 0.09);
}

.resources-page .resource-card h3 {
    margin: 0 0 10px;
    color: var(--resource-dark);
    font-size: 1.12rem;
}

.resources-page .resource-card p {
    margin: 7px 0;
    color: var(--resource-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.resources-page .resource-card strong {
    color: var(--resource-text);
}

.resources-page .resource-card button {
    margin: 12px 8px 0 0;
    padding: 10px 15px;

    border: none;
    border-radius: 8px;

    background: var(--resource-green);
    color: white;
    font-weight: 650;
}

.resources-page .resource-card button:hover {
    background: var(--resource-dark);
}

.resources-page .resource-card .delete-resource-btn {
    background: #fff0ef;
    color: #a52d27;
    border: 1px solid #f2d1ce;
}

.resources-page .resource-card .delete-resource-btn:hover {
    background: #a52d27;
    color: white;
}

/* General resources */

.resources-page .other-resources-section {
    margin-top: 45px;
    padding: 25px;

    background: #edf6f0;
    border: 1px solid #dcebe2;
    border-radius: 18px;
}

.resources-page .other-resources-section .resource-card {
    background: white;
}

/* ==========================================
   FOOTER
========================================== */

.resources-page footer {
    margin-top: 60px;
    padding: 40px 20px;

    background: #073b30;
    color: white;
    text-align: center;
}

.resources-page footer h3 {
    margin-top: 0;
    color: white;
}

.resources-page footer p {
    color: rgba(255, 255, 255, 0.78);
}

.resources-page footer .copyright {
    margin-top: 20px;
    font-size: 0.85rem;
}

/* ==========================================
   RESPONSIVE DESIGN
========================================== */

@media (max-width: 950px) {
    .resources-page .resource-tools {
        grid-template-columns: 1fr 1fr;
    }

    .resources-page #resourceSearch {
        grid-column: 1 / 2;
    }
}

@media (max-width: 600px) {
    .resources-page .page-header {
        min-height: 310px;
        padding: 75px 20px;
    }

    .resources-page .page-header h1 {
        font-size: 2.25rem;
        letter-spacing: -0.7px;
    }

    .resources-page .page-header p {
        font-size: 0.95rem;
    }

    .resources-page .resources-section {
        width: 93%;
        margin-top: 25px;
    }

    .resources-page .resource-tools {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 10px;
    }

    .resources-page .resource-tools > * {
        width: 100%;
    }

    .resources-page .upload-form-container {
        padding: 20px 16px;
    }

    .resources-page .unit-resource-group,
    .resources-page .other-resources-section {
        padding: 15px;
    }

    .resources-page .resource-card {
        padding: 16px;
    }

    .resources-page .resource-card button {
        width: 100%;
        margin-right: 0;
    }

    .resources-page .upload-buttons {
        flex-direction: column;
    }

    .resources-page .upload-buttons button {
        width: 100%;
    }
}

/* Respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
    .resources-page .page-header::before {
        animation: none;
        background-image: url("../assets/images/engineer.jpg");
    }

    .resources-page *,
    .resources-page *::before,
    .resources-page *::after {
        transition-duration: 0.01ms !important;
    }
}
