/* ================== GLOBAL STYLES & VARIABLES ================== */
:root {
    --primary-color: #0a2342; /* Deep Navy Blue */
    --secondary-color: #2ca58d; /* A muted teal for accents */
    --text-color: #333;
    --background-color: #fdfdfd;
    --light-gray: #f4f4f4;
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1, h2, h3 {
    line-height: 1.2;
    font-weight: 600;
}

h1 { font-size: 3rem; margin-bottom: 1rem; color: var(--primary-color); }
h2 { font-size: 2.5rem; margin-bottom: 2rem; text-align: center; color: var(--primary-color); }
h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
a { text-decoration: none; color: var(--primary-color); }
ul { list-style: none; }
section { padding: 5rem 0; }

/* ================== UTILITY & REUSABLE CLASSES ================== */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #0d2c54;
}

/* ================== HEADER / NAVIGATION ================== */
header {
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}
a.logo img {
    height: 2rem;
    vertical-align: top;
    margin-right: 10px;
}

header nav ul {
    display: flex;
    gap: 2rem;
}

header nav a {
    font-weight: 600;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: var(--secondary-color);
}

.nav-logout-form {
    display: inline;
}

.nav-logout-btn {
    font: inherit;
    font-weight: 600;
    color: var(--primary-color);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-logout-btn:hover {
    color: var(--secondary-color);
}

/* ================== HERO SECTION ================== */
#hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 10rem;
    /* For a background image, add a `background` with the image's url(), then
    `no-repeat center center/cover`. (Not written out here: collectstatic
    follows url() even in a comment, and fails on a file that is not there.) */
}

.hero-content {
    max-width: 800px;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* ================== SERVICES SECTION ================== */
#services {
    background-color: var(--light-gray);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.service-card {
    background: #fff;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.service-card .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* ================== ABOUT SECTION ================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    width: 100%;
    height: 350px;
    background: var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.about-image img {
    display: block;
    width: 100%;
    height: auto; 
}

.about-content h2 {
    text-align: left;
}

/* ================== CONTACT SECTION ================== */
#contact {
    background-color: var(--light-gray);
}

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    background: #fff;
    padding: 3rem;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-family);
    font-size: 1rem;
}

.contact-form button {
    width: 100%;
    border: none;
    cursor: pointer;
}

.contact-details p {
    margin-bottom: 1.5rem;
}

.errors {
    color: #b42318;
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem;
}

.errors ul {
    list-style: none;
}

/* ================== PAGES UNDER THE HEADER ================== */
/* The header is fixed, so these pages start far enough down to clear it. */
#login,
#filedrop,
div#privacy-policy {
    padding-top: 8rem;
}

/* ================== FILES ================== */
.file-table {
    margin-top: 2rem;
    overflow-x: auto; /* a very long filename scrolls here, not the page */
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#filedrop table {
    width: 100%;
    border-collapse: collapse;
}

#filedrop th,
#filedrop td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #eee;
}

#filedrop th {
    background: var(--light-gray);
    color: var(--primary-color);
    font-weight: 600;
}

#filedrop tbody tr:last-child td {
    border-bottom: none;
}

#filedrop td a {
    font-weight: 600;
}

#filedrop td a:hover {
    color: var(--secondary-color);
}

#filedrop .file-actions {
    white-space: nowrap;
}

#filedrop .file-actions a + a {
    margin-left: 1rem;
}

.confirm-delete {
    margin-top: 2rem;
}

.confirm-delete p {
    margin-bottom: 1.5rem;
}

.confirm-delete .btn {
    border: none;
    cursor: pointer;
    background: #b42318;
    margin-right: 1rem;
}

.confirm-delete .btn:hover {
    background: #912018;
}

/* ================== LOG IN ================== */

.login-card {
    max-width: 420px;
    margin: 0 auto;
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.login-card h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.login-card label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
}

.login-card input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(44, 165, 141, 0.2);
}

.login-card .btn {
    margin-top: 0.5rem;
}

/* ================== FOOTER ================== */
footer {
    background-color: var(--primary-color);
    color: #fff;
    padding: 4rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

footer .logo,
footer a {
    color: #fff;
}

.copyright {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #ccc;
}

footer h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

footer ul li {
    margin-bottom: 0.5rem;
}

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

.social-links a {
    margin-right: 1rem;
}

/* ================== RESPONSIVE DESIGN ================== */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    header { padding: 0.75rem 0; }
    header nav { flex-direction: column; gap: 0.5rem; }
    header nav.container { padding: 0 1rem; }
    header nav ul { gap: 0.4rem 0.9rem; flex-wrap: wrap; justify-content: center; }
    header nav a,
    .nav-logout-btn { font-size: 0.9rem; white-space: nowrap; }

    #filedrop th,
    #filedrop td { padding: 0.6rem 0.5rem; font-size: 0.9rem; }
    /* "Uploaded by" gives way, so that Download stays in view. */
    #filedrop th:nth-child(2),
    #filedrop td:nth-child(2) { display: none; }

    .services-grid,
    .about-grid,
    .contact-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1; /* Puts image on top in mobile view */
        height: 250px;
    }

    #login,
    #filedrop,
    div#privacy-policy {
        padding-top: 9rem; /* the header is taller here */
    }

    .login-card {
        padding: 1.5rem;
    }

    .about-content h2,
    .contact-details {
        text-align: center;
        margin-top: 2rem;
    }
}

/* ================== SCROLL ANIMATION ================== */

/* This is the initial state of the animated elements (hidden) */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* This class will be added by JavaScript when the element is visible */
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

div#privacy-policy {
    margin: 0 auto;
    padding-right: 2rem;
    padding-bottom: 5rem;
    padding-left: 2rem; /* the top is set with the other pages under the header */
    max-width: 800px;
}
div#privacy-policy a {
    overflow-wrap: anywhere; /* long URLs, on phones */
}
div#privacy-policy h1 {
    font-size: 2rem;
    text-align: center;
}
div#privacy-policy section.pp-section {
    padding: 1rem 0;
}
div#privacy-policy section.pp-section h2 {
    font-size: 1.5rem;
}
div#privacy-policy ul {
    margin: 0 0 1rem 1rem;
}
div#privacy-policy ul li {
    list-style: circle inside;
}
div#privacy-policy p {
    text-align: justify;
}
div#privacy-policy p a {
    text-decoration: underline;
}
