/* Student Details & Portal Styles */

/* Scoped Container to avoid conflicts */
.student-portal-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Header Section */
.student-portal-header {
    background: linear-gradient(135deg, #0a3d62 0%, #1e5799 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.student-portal-header h2.student-name {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.student-portal-header .student-meta {
    margin: 0;
    font-size: 1rem;
    opacity: 1;
    color: #ffffff;
    font-weight: 500;
}

/* Dashboard Grid Layout */
.student-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.student-identity-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.student-actions-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Desktop Layout */
@media (min-width: 769px) {
    .student-dashboard-grid {
        grid-template-columns: 300px 1fr;
        /* Fixed width for identity, flexible for actions */
        align-items: start;
    }
}

/* Actions Bar (Update Key Details) */
.student-actions-bar {
    text-align: left;
    /* Align left on desktop */
    margin-bottom: 0;
    /* Remove margin as it's inside the flex container */
}

.student-actions-bar a {
    display: block;
    /* Make full width in its container */
    text-align: center;
    padding: 12px 20px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.student-actions-bar a:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Media Section (Photo, Signature, Actions) */
.student-media-card {
    /* Removed background and shadow for cleaner look */
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.student-media-card.actions-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 20px;
    height: 100%;
    /* Fill height if needed */
}

.student-media-card.actions-card h3 {
    margin-top: 0;
    color: #0a3d62;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    width: 100%;
    text-align: left;
}

.student-media-img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    /* Slightly larger on desktop */
    border-radius: 8px;
    border: 4px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 15px;
}

.student-signature-img {
    max-width: 150px;
    max-height: 80px;
    width: auto;
    border: 2px solid #eee;
}

.student-action-btn {
    display: inline-block;
    margin-top: 5px;
    padding: 6px 12px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.student-action-btn:hover {
    background-color: #5a6268;
}

/* Action List in Actions Card */
.action-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Grid for actions */
    gap: 15px;
    width: 100%;
}

.action-list a {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    color: #0a3d62;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
    text-align: left;
    font-weight: 500;
}

.action-list a:hover {
    background-color: #e2e6ea;
    border-color: #dae0e5;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Info Grid Section */
.student-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.student-info-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.student-info-header {
    background-color: #e9ecef;
    padding: 10px 15px;
    font-weight: 600;
    color: #0a3d62;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}

.student-info-content {
    padding: 15px;
}

.student-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

.student-info-row:last-child {
    border-bottom: none;
}

.student-info-label {
    font-weight: 500;
    color: #555;
}

.student-info-value {
    color: #333;
    font-weight: 400;
}

/* Batches / Programmes Grid */
.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.program-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #0a3d62;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.program-card h2 {
    margin-top: 0;
    color: #0a3d62;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.program-card p {
    margin: 8px 0;
    color: #555;
    font-size: 0.95rem;
}

.program-card strong {
    color: #333;
}

/* Attendance Section Styles */
.attendance-container {
    max-width: 100%;
    /* Full width */
    margin: 0 auto;
}

.attendance-card {
    background: white;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.attendance-header {
    padding: 15px;
    background-color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s;
}

.attendance-header:hover {
    background-color: #f8f9fa;
}

.attendance-header.active {
    border-bottom-color: #eee;
    background-color: #f8f9fa;
}

.attendance-summary {
    font-size: 0.9rem;
}

.attendance-details {
    display: none;
    padding: 0;
    background-color: #fafafa;
}

.attendance-details table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.attendance-details th,
.attendance-details td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.attendance-details th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 600;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge.P {
    background-color: #d4edda;
    color: #155724;
}

.badge.A {
    background-color: #f8d7da;
    color: #721c24;
}

.badge.L {
    background-color: #fff3cd;
    color: #856404;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .student-portal-header {
        text-align: center;
    }

    .student-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .action-list {
        grid-template-columns: 1fr;
    }

    .student-info-grid {
        grid-template-columns: 1fr;
    }
}