:root {
    --primary-gradient: linear-gradient(135deg, #5b75e7, #8e54e9);
    --bg-color: #f0f2f5;
    --text-dark: #333;
    --text-muted: #666;
    --danger-text: #d32f2f;
    --nav-bg: #2a2a2a;
    --border-color: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
}

/* Utility Classes */
.hidden { display: none !important; }
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.notice-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4fc3f7;
    font-size: 0.9em;
    color: var(--text-muted);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin: 20px auto;
    max-width: 1000px;
    width: 95%;
}

.btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; }

/* Login Page */
#login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.login-header {
    background: var(--primary-gradient);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

.logo-ellipse {
    background: white;
    border-radius: 50%;
    width: 80%;
    max-width: 250px;
    padding: 15px 30px;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}
.logo-ellipse img {
    width: 100%;
    height: auto;
    display: block;
}

.login-header h2 {
    font-size: 1.1em;
    margin-bottom: 5px;
}
.login-header p {
    font-size: 0.8em;
    margin-bottom: 10px;
    opacity: 0.9;
}
.login-header .badge {
    background: rgba(0,0,0,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    display: inline-block;
}

.login-body { padding: 25px; }

.form-group { margin-bottom: 15px; }
.form-group label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #f9f9f9;
}

.security-check {
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}
.security-label {
    font-size: 0.75em;
    font-weight: bold;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: block;
}
.captcha-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.captcha-img {
    background: white;
    border: 1px solid var(--border-color);
    padding: 5px 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2em;
    font-weight: bold;
    color: #d81b60;
    text-decoration: line-through;
    letter-spacing: 2px;
}
.captcha-refresh {
    padding: 0 10px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}
.btn-login { width: 100%; padding: 12px; margin-bottom: 15px; }
.forgot-pass { text-align: center; display: block; font-size: 0.85em; color: var(--text-muted); text-decoration: none;}

/* Dashboard Global */
.dash-header {
    background: white;
    text-align: center;
    padding: 15px;
}
.dash-header h1 { color: var(--danger-text); font-size: 1.2em; }
.dash-header p { color: var(--danger-text); font-size: 0.9em; }
.dash-header .sub-dept { font-size: 0.85em; color: var(--text-dark); margin-top: 5px;}

.navbar {
    background: var(--nav-bg);
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px;
}
.navbar a {
    color: white;
    text-decoration: none;
    font-size: 0.85em;
    cursor: pointer;
}
.navbar a:hover { color: #ccc; }

.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Home / Result Section */
.search-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid #5b75e7;
}
.search-card .form-group { margin-bottom: 0; flex: 1; }
.semester-label {
    font-size: 0.7em;
    font-weight: bold;
    color: var(--text-muted);
}

.student-info-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-color);
}
.info-item label {
    display: block;
    font-size: 0.7em;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}
.info-item span { font-size: 0.9em; font-weight: 600; color: #111; }
.full-width { grid-column: 1 / -1; }

.table-responsive { overflow-x: auto; padding: 20px; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}
th, td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
}
th { background-color: #f1f3f5; color: var(--text-muted); font-weight: 600; }

/* =========================================
   UPDATED PROFILE SECTION
   ========================================= */
.profile-header {
    background: var(--primary-gradient);
    height: 160px; /* Made slightly taller */
    position: relative;
    border-radius: 8px 8px 0 0; 
}

.profile-img {
    width: 130px; /* Larger, clearer size */
    height: 130px; /* Larger, clearer size */
    background: #f0f2f5; 
    border-radius: 50%;
    border: 5px solid #dcdff8; /* Light lavender/blue border exactly like the photo */
    position: absolute;
    bottom: -65px; /* Perfectly aligns halfway across the line */
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Softer, highly realistic drop shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5em; /* Larger placeholder emoji if photo is missing */
    color: #ccc;
    overflow: hidden; 
    z-index: 10;
}

.profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top; /* Centers the face properly in portraits */
    display: block;
}

.profile-details { 
    padding: 85px 25px 25px 25px; /* Added more top padding so text doesn't overlap the bigger photo */
}

.profile-grid { border: none; background: white; }
.profile-name { color: #5b75e7 !important; }

@media (max-width: 600px) {
    .search-card { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; }
}