/* =====================================================
   Sistem Pengumuman Nilai Mahasiswa - Stylesheet
   ===================================================== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
}

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

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-box .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-box .logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-box .logo img {
    max-width: 120px;
    height: auto;
}

.login-box .logo i {
    font-size: 60px;
    color: #1e3c72;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #1e3c72;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(30, 60, 114, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #1e3c72;
    font-size: 22px;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header .user-info span {
    color: #666;
}

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c82333;
}

/* Student Info Card */
.student-info {
    background: white;
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.student-info h2 {
    color: #1e3c72;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Info Table */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    padding: 8px 5px;
    vertical-align: top;
}

.info-table .label-col {
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    width: 160px;
}

.info-table .separator {
    width: 15px;
    text-align: center;
    color: #666;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
}

.info-item .label {
    width: 150px;
    color: #666;
    font-weight: 500;
}

.info-item .value {
    color: #333;
    font-weight: 600;
}

/* KHS Table */
.khs-container {
    background: white;
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow-x: auto;
}

.khs-container h2 {
    color: #1e3c72;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.khs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.khs-table thead {
    background: #1e3c72;
    color: white;
}

.khs-table th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
}

.khs-table th.left {
    text-align: left;
}

.khs-table tbody tr {
    border-bottom: 1px solid #e1e1e1;
    transition: background 0.3s;
}

.khs-table tbody tr:hover {
    background: #f8f9fa;
}

.khs-table td {
    padding: 15px 12px;
    text-align: center;
}

.khs-table td.left {
    text-align: left;
}

.khs-table .nilai-header {
    background: #2a5298;
}

/* Mobile/Desktop visibility */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: table;
}

/* Mobile Cards */
.khs-cards {
    flex-direction: column;
    gap: 10px;
}

.khs-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    border-left: 4px solid #1e3c72;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.card-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-number {
    background: #1e3c72;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-code {
    color: #1e3c72;
    font-size: 12px;
    font-weight: 600;
}

.card-sks {
    color: #888;
    font-size: 10px;
}

.card-grade {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.card-dosen {
    color: #666;
    font-size: 11px;
    margin-bottom: 6px;
    padding-left: 32px;
}

.card-dosen i {
    margin-right: 4px;
    color: #888;
}

.card-title {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.3;
    padding-left: 32px;
}

.card-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.detail-item {
    text-align: center;
    background: #f8f9fa;
    padding: 6px 4px;
    border-radius: 6px;
}

.detail-label {
    display: block;
    font-size: 9px;
    color: #888;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.detail-value {
    display: block;
    font-weight: 700;
    color: #1e3c72;
    font-size: 13px;
}

/* Mobile Info Grid */
.info-mobile {
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    gap: 8px;
}

.info-cell {
    flex: 1;
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 8px;
}

.info-cell.full {
    flex: 1 1 100%;
}

.info-label {
    display: block;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.info-value {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

/* Desktop info table */
.desktop-info {
    display: table;
}

/* Nilai yang belum bisa dilihat (EDOM belum diisi) */
.nilai-hidden {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nilai-hidden .btn-edom {
    background: #ffc107;
    color: #333;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.nilai-hidden .btn-edom:hover {
    background: #e0a800;
    transform: scale(1.05);
}

.nilai-hidden .btn-edom i {
    font-size: 14px;
}

.nilai-locked {
    color: #dc3545;
    font-style: italic;
    font-size: 12px;
}

/* Card locked state */
.card-locked {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.card-grade-locked {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.card-edom-action {
    margin-top: 10px;
}

.btn-edom-mobile {
    display: block;
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
}

.btn-edom-mobile:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-edom-mobile i {
    margin-right: 5px;
}

/* Summary Section */
.khs-summary {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.khs-summary-locked {
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
}

.summary-locked-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6c757d;
    font-size: 15px;
    font-weight: 500;
}

.summary-locked-message i {
    color: #adb5bd;
    font-size: 18px;
}

.summary-item {
    text-align: center;
}

.summary-item .label {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.summary-item .value {
    color: #1e3c72;
    font-size: 20px;
    font-weight: 700;
}

/* Notes */
.notes {
    background: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
}

.notes i {
    margin-right: 8px;
}

/* Footer */
.footer {
    text-align: right;
    color: white;
    padding: 20px;
    font-size: 14px;
}

/* EDOM Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.3s;
}

.modal-close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 25px;
}

.modal-body .course-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.modal-body .course-info p {
    margin: 5px 0;
    color: #333;
}

.modal-body .course-info strong {
    color: #1e3c72;
}

/* EDOM Petunjuk */
.edom-petunjuk {
    background: #e8f4fd;
    border-left: 4px solid #1e3c72;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.edom-petunjuk p:first-child {
    margin-bottom: 8px;
    color: #1e3c72;
}

/* EDOM Sections */
.edom-section {
    margin-bottom: 25px;
}

.edom-section h4 {
    color: #1e3c72;
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e1e1;
}

/* EDOM Questions */
.edom-question {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.edom-question.error {
    background: #fff5f5;
    border: 2px solid #dc3545;
}

.edom-question > label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.question-desc {
    color: #666;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Star Rating */
.star-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.star-rating i {
    font-size: 28px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.star-rating i:hover {
    transform: scale(1.2);
}

.star-rating i.fas {
    color: #ffc107;
}

.star-rating i.active {
    color: #ffc107;
    animation: starPop 0.3s ease;
}

@keyframes starPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.rating-text {
    margin-left: 10px;
    font-size: 13px;
    color: #666;
    font-style: italic;
    min-width: 100px;
}

.rating-text.selected {
    color: #1e3c72;
    font-weight: 600;
    font-style: normal;
}

/* Radio Group (keep for backwards compatibility) */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    border: 2px solid #e1e1e1;
    transition: all 0.3s;
    flex: 1;
    min-width: 100px;
}

.radio-group label:hover {
    border-color: #1e3c72;
    background: #f0f5ff;
}

.radio-group input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #1e3c72;
}

.radio-group input[type="radio"]:checked + label,
.radio-group label:has(input[type="radio"]:checked) {
    background: #1e3c72;
    color: white;
    border-color: #1e3c72;
}

/* Form Textarea */
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: #1e3c72;
}

.form-textarea:invalid {
    border-color: #dc3545;
}

.required {
    color: #dc3545;
    font-weight: bold;
}

.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #888;
}

/* EDOM Note */
.edom-note {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f4fd;
    border-radius: 8px;
    border-left: 4px solid #1e3c72;
}

/* EDOM Confirm Checkbox */
.edom-confirm {
    margin-top: 15px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: #28a745;
    border-color: #28a745;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Rating Group */
.rating-group {
    margin-bottom: 20px;
}

.rating-group label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 500;
}

.rating-options {
    display: flex;
    gap: 10px;
}

.rating-options input[type="radio"] {
    display: none;
}

.rating-options label {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.rating-options input[type="radio"]:checked + label {
    background: #1e3c72;
    color: white;
}

.rating-options label:hover {
    background: #2a5298;
    color: white;
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 11px;
    color: #999;
}

.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #1e3c72;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e1e1e1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 15px;
        border-radius: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header .user-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .student-info {
        padding: 15px;
        border-radius: 10px;
    }
    
    .student-info h2 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    /* Hide desktop info table, show mobile grid */
    .desktop-info {
        display: none !important;
    }
    
    .info-mobile {
        display: flex !important;
    }
    
    .khs-container {
        padding: 12px;
        border-radius: 10px;
    }
    
    .khs-container h2 {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    .khs-summary {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: space-between;
        margin-top: 15px;
    }
    
    .summary-item {
        padding: 10px 8px;
        flex: 1;
        min-width: 100px;
        background: white;
        border-radius: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    
    /* Show cards, hide table on mobile */
    .mobile-only {
        display: flex !important;
        margin-top: 0;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .footer {
        font-size: 12px;
        padding: 15px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .main-container {
        padding: 8px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .student-info {
        padding: 12px;
    }
    
    .student-info h2 {
        font-size: 14px;
    }
    
    .info-cell {
        padding: 8px 10px;
    }
    
    .info-value {
        font-size: 12px;
    }
    
    .card-title {
        font-size: 12px;
        padding-left: 32px;
    }
    
    .summary-item {
        min-width: 70px;
        padding: 8px 6px;
    }
    
    .summary-item .value {
        font-size: 14px;
    }
    
    .summary-item .label {
        font-size: 9px;
    }
    
    /* EDOM Form Responsive */
    .modal {
        max-width: 100%;
        border-radius: 10px;
        margin: 10px;
    }
    
    .modal-header {
        padding: 15px;
        border-radius: 10px 10px 0 0;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .edom-petunjuk {
        font-size: 12px;
        padding: 12px;
    }
    
    .edom-section h4 {
        font-size: 14px;
    }
    
    .edom-question {
        padding: 12px;
    }
    
    .edom-question > label {
        font-size: 13px;
    }
    
    .question-desc {
        font-size: 12px;
    }
    
    .star-rating {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .star-rating i {
        font-size: 32px;
    }
    
    .rating-text {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
        text-align: center;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .radio-group label {
        min-width: auto;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Status Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1e3c72;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
