/* style.css */
:root {
    --primary-color: #0056b3;
    --primary-hover: #004494;
    --secondary-color: #007bff;
    --success-color: #28a745;
    --error-color: #dc3545;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #6c757d;
    --text-color: #343a40;
    --white: #fff;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-color);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* Header */
.site-header {
    width: 100%;
    max-width: 800px;
    margin-bottom: 2rem;
    text-align: center;
}
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.logo {
    height: 50px;
    width: auto;
}
.college-name h1 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--primary-color);
    font-weight: 700;
}
.college-name h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--dark-gray);
    font-weight: 400;
}

/* Main Content & Verification Card */
.main-content {
    width: 100%;
    max-width: 650px;
}
.verification-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}
.verification-card h2 {
    margin-top: 0;
    font-size: 1.8rem;
    font-weight: 600;
}
.verification-card .subtitle {
    margin-top: -1rem;
    margin-bottom: 2rem;
    color: var(--dark-gray);
}

/* Verification Form */
.verify-form {
    display: flex;
    gap: 10px;
}
.verify-form input {
    flex-grow: 1;
    padding: 14px 18px;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.verify-form input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}
.verify-form button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.2s, box-shadow 0.3s;
}
.verify-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 91, 179, 0.3);
}

/* Result Area */
.result-area {
    margin-top: 2.5rem;
}
.result-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 6px solid;
    box-shadow: var(--box-shadow);
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}
.result-card h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}
.result-card p {
    margin: 0;
    color: var(--dark-gray);
    line-height: 1.6;
}
.result-card .icon-bg {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

/* Success State */
.result-card.success {
    border-color: var(--success-color);
}
.result-card.success .icon-bg {
    background-color: var(--success-color);
}
.result-card.success h3 {
    color: var(--success-color);
}
.details-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.8rem 1.5rem;
    margin-top: 1.5rem;
    text-align: left;
}
.details-grid span {
    font-weight: 500;
    color: var(--text-color);
}
.details-grid p {
    margin: 0;
    color: var(--dark-gray);
}
.print-footer {
    display: none; /* Hidden by default, only shown on print */
}


/* Error State */
.result-card.error {
    border-color: var(--error-color);
}
.result-card.error .icon-bg {
    background-color: var(--error-color);
}
.result-card.error h3 {
    color: var(--error-color);
}

/* Footer */
.site-footer {
    width: 100%;
    max-width: 800px;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--medium-gray);
    text-align: center;
    color: var(--dark-gray);
    font-size: 0.9rem;
}
.site-footer p {
    margin: 0.3rem 0;
}
.footer-links {
    margin-top: 1rem;
}
.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 10px;
}
.footer-links a:hover {
    text-decoration: underline;
}

/* Print Button */
.print-button-container {
    margin-top: 1.5rem;
    text-align: center;
}
.print-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border: 1px solid var(--medium-gray);
    background-color: var(--white);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s, color 0.3s, transform 0.2s;
}
.print-btn:hover {
    background-color: var(--dark-gray);
    color: var(--white);
    border-color: var(--dark-gray);
    transform: translateY(-2px);
}


/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .page-wrapper {
        padding: 1rem;
    }
    .verification-card {
        padding: 1.5rem;
    }
    .verify-form {
        flex-direction: column;
    }
    .details-grid {
        grid-template-columns: 1fr;
    }
    .details-grid span {
        border-bottom: 1px solid var(--medium-gray);
        padding-bottom: 0.5rem;
        margin-bottom: -0.3rem;
    }
}

/* --- PRINT STYLES --- */
/* These styles are ONLY applied when the user prints the page */
@media print {
    /* Hide everything that shouldn't be printed */
    body > .page-wrapper > *:not(.main-content),
    .main-content > *:not(.result-area),
    .result-area > *:not(#printable-area),
    .print-button-container {
        display: none !important;
    }

    /* Reset body and page styles for printing */
    body, .page-wrapper {
        background-color: var(--white) !important;
        padding: 0;
        margin: 0;
    }

    /* Ensure the printable area takes up the full page */
    #printable-area {
        width: 100%;
        max-width: 100%;
    }
    .result-card {
        box-shadow: none !important;
        border: 2px solid #000;
        border-radius: 0;
        margin: 0;
        padding: 1.5in; /* Add padding for a formal look */
    }
    .print-footer {
        display: block; /* Show the print footer */
        margin-top: 2rem;
        padding-top: 1rem;
        border-top: 1px solid var(--medium-gray);
        font-size: 0.8rem;
        color: #666;
        text-align: center;
    }
    .result-card.success .icon-bg {
        /* Optional: Change icon color for black & white printing */
        background-color: #eee !important;
        color: #000 !important;
    }
}


/* --- ADMIN STYLES --- */
/* This section contains the styles for the admin.php page */
.container.admin-container {
    max-width: 1000px;
    text-align: left;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--medium-gray);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
.logout-btn {
    background-color: var(--error-color);
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    margin-left: 1rem;
}
.admin-section {
    margin-bottom: 2.5rem;
    border: 1px solid var(--medium-gray);
    padding: 1.5rem;
    border-radius: 5px;
}
.admin-section h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}
.admin-form .form-group {
    margin-bottom: 1rem;
}
.admin-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.admin-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    box-sizing: border-box;
}
.admin-form button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    background: var(--primary-color);
    transition: background-color 0.3s;
}
.admin-form button:hover {
    background: var(--primary-hover);
}
.message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border: 1px solid transparent;
}
.message.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.message.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}
thead th {
    background-color: #f8f9fa;
}
.actions .btn {
    color: white;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 3px;
    margin-right: 5px;
    font-size: 0.9em;
}
.btn.edit { background-color: #ffc107; }
.btn.delete { background-color: #dc3545; }
.search-form {
    margin-bottom: 1rem;
}
.clear-search {
    padding: 12px 20px;
    text-decoration: none;
    background: #6c757d;
    color: white;
    border-radius: 4px;
}
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
}
.back-link:hover {
    text-decoration: underline;
}
.manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.btn.add-new-btn {
    background-color: var(--success-color);
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}
.btn.add-new-btn:hover {
    background-color: #218838;
}
@media (max-width: 600px) {
    .manage-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn.add-new-btn {
        margin-top: 10px;
        width: 100%;
        text-align: center;
    }
}
/* --- NEW ADMIN PANEL STYLES --- */
/* Add this entire block to the end of your style.css file */

.admin-page-header {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-welcome {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}

.admin-card {
    margin-bottom: 2rem;
}

.admin-card .subtitle {
    margin-top: -0.5rem;
}

.admin-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.admin-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

.admin-form .form-group {
    margin-bottom: 1.2rem;
}

.full-width-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    color: white;
    transition: transform 0.2s, box-shadow 0.3s;
}
.full-width-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 91, 179, 0.3);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}
.form-header h1 {
    margin-bottom: 0.5rem;
}

.upload-form {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.upload-form p {
    margin: 0;
    flex-basis: 100%;
}
.upload-form input[type="file"] {
    flex-grow: 1;
}
.upload-form button {
    padding: 12px 20px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}
.upload-form button:hover {
    background-color: var(--primary-hover);
}

.clear-search {
    padding: 14px 20px;
    text-decoration: none;
    background: var(--dark-gray);
    color: white;
    border-radius: 8px;
    transition: background-color 0.3s;
}
.clear-search:hover {
    background: #5a6268;
}

/* Responsive Table Styles */
@media (max-width: 768px) {
    .table-container table thead {
        display: none; /* Hide table headers on mobile */
    }
    .table-container table,
    .table-container table tbody,
    .table-container table tr,
    .table-container table td {
        display: block;
        width: 100%;
    }
    .table-container table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--medium-gray);
        border-radius: 8px;
        overflow: hidden;
    }
    .table-container table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid var(--medium-gray);
    }
    .table-container table td:last-child {
        border-bottom: none;
    }
    .table-container table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        text-align: left;
        font-weight: 600;
        color: var(--primary-color);
    }
    .actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }
}
/* --- NEW COURSE SUMMARY STYLES --- */
/* Add this block to the end of your style.css file */

.summary-container {
    max-height: 300px; /* Add a scrollbar if the list is long */
    overflow-y: auto;
    margin-top: 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
}

.summary-container table {
    width: 100%;
    border-collapse: collapse;
}

.summary-container th,
.summary-container td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

.summary-container tbody tr:last-child td {
    border-bottom: none;
}

.summary-container th {
    background-color: var(--light-gray);
    font-weight: 600;
    position: sticky; /* Keep headers visible on scroll */
    top: 0;
}

.summary-container td:last-child {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    width: 150px; /* Fixed width for the count column */
}
/* --- NEW COMPACT & ATTRACTIVE SUMMARY STYLES --- */
/* Replace the previous summary styles with this block */

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.total-students {
    background-color: var(--light-gray);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Made cards smaller */
    gap: 1rem; /* Reduced gap */
    max-height: 400px; /* Added max height */
    overflow-y: auto; /* Added scroll for overflow */
    padding-right: 10px; /* Added padding for scrollbar */
}

.summary-card {
    background-color: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 1rem; /* Reduced padding */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.summary-card h3 {
    margin-top: 0;
    margin-bottom: 0.25rem; /* Reduced margin */
    font-size: 1rem; /* Reduced font size */
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-count {
    font-size: 1.25rem; /* Reduced font size */
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem; /* Reduced margin */
}

.progress-bar-container {
    background-color: var(--medium-gray);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

/* --- NEW FILTER FORM STYLES --- */
/* Add this block to the end of your style.css file */

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.filter-input, .filter-select {
    flex: 1 1 200px; /* Allow items to grow and shrink */
    padding: 14px;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

.filter-btn {
    padding: 14px 20px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.filter-btn:hover {
    background-color: var(--primary-hover);
}
/* --- NEW COMPACT DRAG & DROP UPLOADER STYLES --- */
/* Replace the previous uploader styles with this block */

.drop-zone {
    border: 2px dashed var(--medium-gray); /* Thinner border */
    border-radius: var(--border-radius);
    padding: 1.5rem; /* Reduced padding */
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    position: relative;
}

.drop-zone.highlight {
    border-color: var(--primary-color);
    background-color: #f0f8ff; /* A light blue tint */
}

.drop-zone-prompt svg {
    color: var(--primary-color);
    margin-bottom: 0.5rem; /* Reduced margin */
    width: 32px; /* Smaller icon */
    height: 32px;
}

.drop-zone-prompt p {
    margin: 0 0 0.5rem;
    font-size: 1rem; /* Reduced font size */
}

.or-divider {
    display: block;
    margin: 0.75rem auto; /* Reduced margin */
    color: var(--dark-gray);
    font-size: 0.9rem;
}

.browse-btn {
    padding: 8px 16px; /* Smaller button */
    border: 1px solid var(--primary-color);
    background-color: var(--white);
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem; /* Reduced font size */
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
}

.browse-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.drop-zone-input {
    display: none; /* Hide the actual file input */
}

.file-info {
    display: none; /* Hidden by default */
    font-size: 1rem;
    color: var(--text-color);
    padding: 1.5rem 0; /* Reduced padding */
}

#upload-btn:disabled {
    background: var(--medium-gray);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
#upload-btn:disabled:hover {
    background: var(--medium-gray);
}

/* --- NEW TEMPLATE LINK STYLES --- */
/* Add this block to the end of your style.css file */

.upload-instructions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.upload-instructions .subtitle {
    margin: 0;
}

.template-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--light-gray);
    border: 1px solid var(--medium-gray);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.template-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}
/* --- NEW QR CODE STYLES --- */
/* Add this block to the end of your style.css file */

.printable-content {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 2rem;
}

.printable-content .details-grid {
    flex-grow: 1;
}

.qrcode-container {
    display: none; /* Hide QR code by default on screen */
    text-align: center;
    flex-shrink: 0;
}

.qrcode-container p {
    font-size: 0.8rem;
    color: #333;
    margin-top: 0.5rem;
}

#qrcode {
    border: 4px solid #000;
    padding: 4px;
    background: white;
}


/* --- MODIFICATIONS FOR PRINT VIEW --- */
/* Add these styles inside your existing @media print block */
@media print {
    .printable-content {
        display: flex !important;
        align-items: flex-start !important;
        gap: 2rem !important;
    }

    .qrcode-container {
        display: block !important; /* Make QR code visible on print */
    }

    .result-card .icon-bg {
        display: none !important; /* Hide the checkmark icon in print to save space */
    }
}
/* --- MODIFICATIONS FOR PRINT VIEW --- */
/* Replace your old @media print block with this one */
@media print {
    .printable-content {
        display: flex !important;
        flex-direction: column !important; /* Stack items vertically */
        align-items: center !important;   /* Center items horizontally */
        gap: 2rem !important;
    }

    .qrcode-container {
        display: block !important; /* Make QR code visible on print */
    }

    .result-card .icon-bg {
        display: none !important; /* Hide the checkmark icon in print to save space */
    }
}