/* static/css/style.css */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }
body { background: #f9fafb; color: #1f2937; }

/* Navbar Responsive */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #111827; 
    color: #f9fafb; 
    padding: 1rem 1.5rem; 
    flex-wrap: wrap; 
}
.nav-brand { font-size: 1.25rem; font-weight: bold; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.navbar a { 
    color: #e5e7eb; 
    text-decoration: none; 
    padding: 0.5rem 0.75rem; 
    border-radius: 0.375rem; 
    transition: background 0.2s; 
}
.navbar a:hover { background: rgba(255, 255, 255, 0.1); }

/* Mobile Navbar */
@media (max-width: 640px) {
    .navbar { flex-direction: column; text-align: center; gap: 1rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; width: 100%; }
    .navbar a { background: rgba(255,255,255,0.05); width: 100%; display: block; }
}

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

/* Cards */
.card { background: #ffffff; border-radius: 0.75rem; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }

/* Forms */
.pin-form { display: flex; flex-direction: column; gap: 1rem; max-width: 400px; margin: 0 auto; }
.modern-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-group { display: flex; flex-direction: column; }
.form-group label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; color: #374151; }
.form-group input, .form-group select { 
    padding: 0.75rem; 
    border: 1px solid #d1d5db; 
    border-radius: 0.5rem; 
    font-size: 1rem;
}

/* Buttons */
button, .btn-primary { 
    padding: 0.75rem 1.5rem; 
    border-radius: 0.5rem; 
    border: none; 
    background: #2563eb; 
    color: #fff; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 1rem;
    transition: background 0.2s;
}
button:hover, .btn-primary:hover { background: #1d4ed8; }

/* Scrollable Tables for Mobile */
.table-wrapper { 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    margin-bottom: 1rem; 
    border-radius: 0.5rem; 
    border: 1px solid #e5e7eb; 
}
.data-table { 
    width: 100%; 
    min-width: 600px; /* Forces scroll on small screens */
    border-collapse: collapse; 
}
.data-table th, .data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #e5e7eb; text-align: left; }
.data-table th { background: #f3f4f6; font-weight: 600; }

/* Badges */
.badge { padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.badge-sem { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-mid { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Accordion */
.sem-accordion {
    background: white; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 1rem;
    overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.sem-accordion summary {
    padding: 1rem 1.25rem; cursor: pointer; background: #f9fafb; font-weight: 600;
    display: flex; justify-content: space-between; align-items: center;
    list-style: none; user-select: none; transition: background 0.2s;
}
.sem-accordion summary:hover { background: #f3f4f6; }
.sem-accordion[open] summary { background: #eff6ff; color: #1d4ed8; border-bottom: 1px solid #e5e7eb; }
.sem-accordion summary::-webkit-details-marker { display: none; }

.paper-count { background: #e5e7eb; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; color: #374151; }
.accordion-content { padding: 1.5rem; background: #fff; }

/* Exam Grid */
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.paper-card { 
    background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 1rem; 
    display: flex; flex-direction: column; justify-content: space-between; 
    transition: all 0.2s; border-left: 4px solid #3b82f6; 
}
.paper-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

/* Utils */
.flash-msg { background: #fee2e2; color: #991b1b; padding: 0.75rem; border-radius: 0.5rem; margin-bottom: 1rem; }
.footer { text-align: center; padding: 2rem 1rem; font-size: 0.9rem; color: #6b7280; }


/* At the end of file or under .table-wrapper section */
@media (max-width: 768px) {
    .table-wrapper, .data-table {
        overflow-x: auto;
        min-width: 400px; /* or as needed */
    }
}