/* ATMS Styles */

#atms-app {
    font-family: Arial, sans-serif;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
}

.atms-auth-box {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.atms-auth-box h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.atms-auth-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.atms-btn {
    width: 100%;
    padding: 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.atms-btn:hover {
    background: #005a87;
}

.atms-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.atms-btn-sm {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 5px;
    transition: background 0.3s;
}

.atms-btn-sm:hover {
    background: #005a87;
}

.atms-link {
    text-align: center;
    color: #0073aa;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.atms-link:hover {
    text-decoration: underline;
}

#atms-message {
    margin-top: 15px;
}

#atms-message .success {
    padding: 10px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

#atms-message .error {
    padding: 10px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* ATMS Styles */

#atms-app {
    font-family: Arial, sans-serif;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
}

.atms-auth-box {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.atms-auth-box h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.atms-auth-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.atms-btn {
    width: 100%;
    padding: 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.atms-btn:hover {
    background: #005a87;
}

.atms-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.atms-btn-sm {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 5px;
    transition: background 0.3s;
}

.atms-btn-sm:hover {
    background: #005a87;
}

.atms-link {
    text-align: center;
    color: #0073aa;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.atms-link:hover {
    text-decoration: underline;
}

#atms-message {
    margin-top: 15px;
}

#atms-message .success {
    padding: 10px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

#atms-message .error {
    padding: 10px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.atms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.atms-header h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.atms-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.atms-user-info span {
    font-weight: bold;
    color: #555;
}

.atms-main-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.atms-nav-btn {
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #0073aa;
    color: #0073aa;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.atms-nav-btn:hover {
    background: #0073aa;
    color: #fff;
}

.atms-nav-btn.active {
    background: #0073aa;
    color: #fff;
}

.atms-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.atms-section h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.atms-sub-nav {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.atms-sub-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.atms-sub-btn:hover {
    background: #e9ecef;
}

.atms-sub-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

#atms-sub-content {
    margin-top: 20px;
}

.atms-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.atms-input-sm {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.atms-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

.atms-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.atms-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.atms-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.atms-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
}

.atms-table th,
.atms-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.atms-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.atms-table tr:nth-child(even) {
    background: #f9f9f9;
}

.atms-table tr:hover {
    background: #f1f1f1;
}

.atms-take-attendance,
.atms-edit-attendance,
.atms-delete-attendance,
.atms-report {
    padding: 20px;
}

.atms-take-attendance h3,
.atms-edit-attendance h3,
.atms-delete-attendance h3,
.atms-report h3 {
    margin-top: 0;
    color: #333;
}

.atms-attendance-student {
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
}

.atms-attendance-student h3 {
    color: #0073aa;
    margin-top: 0;
}

.atms-attendance-student p {
    font-size: 18px;
    margin: 10px 0;
}

.atms-attendance-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.present-btn {
    background: #28a745;
}

.present-btn:hover {
    background: #218838;
}

.absent-btn {
    background: #dc3545;
}

.absent-btn:hover {
    background: #c82333;
}

.atms-attendance-summary {
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.atms-attendance-summary h3 {
    color: #0073aa;
    margin-top: 0;
}

.atms-attendance-summary p {
    font-size: 16px;
    margin: 10px 0;
}

.atms-add-students,
.atms-edit-students,
.atms-delete-students,
.atms-print-students {
    padding: 20px;
}

.atms-edit-class-item,
.atms-delete-class-item {
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.atms-add-class,
.atms-edit-class,
.atms-delete-class,
.atms-class-summary {
    padding: 20px;
}

.atms-add-result,
.atms-edit-result,
.atms-delete-result,
.atms-print-result {
    padding: 20px;
}

.atms-note {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: 10px;
}

.atms-report-display {
    overflow-x: auto;
    margin-top: 20px;
}

.atms-report-display h4 {
    margin-top: 30px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.atms-report-display ul {
    list-style-type: none;
    padding: 0;
}

.atms-report-display li {
    padding: 8px;
    background: #f8f9fa;
    margin-bottom: 5px;
    border-radius: 4px;
}

#report-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .atms-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .atms-main-nav {
        flex-direction: column;
    }
    
    .atms-nav-btn {
        width: 100%;
    }
    
    .atms-sub-nav {
        flex-direction: column;
    }
    
    .atms-sub-btn {
        width: 100%;
    }
    
    .atms-attendance-buttons {
        flex-direction: column;
    }
    
    .atms-btn-sm {
        width: 100%;
        margin: 5px 0;
    }
    
    .atms-table {
        font-size: 12px;
    }
    
    .atms-table th,
    .atms-table td {
        padding: 8px;
    }
}

/* Print Styles */
@media print {
    .atms-header,
    .atms-nav-btn,
    .atms-sub-nav,
    .atms-btn,
    .atms-btn-sm,
    #report-actions {
        display: none !important;
    }
    
    .atms-section {
        box-shadow: none;
        padding: 0;
    }
    
    .atms-table {
        page-break-inside: auto;
    }
    
    .atms-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* Calendar Styles */
.atms-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.atms-calendar-day {
    padding: 15px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.atms-calendar-day:hover {
    background: #e9ecef;
}

.atms-calendar-day.has-attendance {
    background: #d4edda;
    border-color: #28a745;
    font-weight: bold;
}

.atms-calendar-day.selected {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.atms-calendar-header {
    font-weight: bold;
    background: #f8f9fa;
    padding: 10px;
    text-align: center;
}

/* Loading Spinner */
.atms-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.atms-loading::after {
    content: " .";
    animation: dots 1s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: " ."; }
    40% { content: " .."; }
    60% { content: " ..."; }
    80%, 100% { content: " ...."; }
}

/* Empty State */
.atms-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.atms-empty-state h3 {
    color: #999;
    font-size: 20px;
}

/* Success/Error Messages */
.atms-alert {
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.atms-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.atms-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.atms-alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Badge */
.atms-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 12px;
    background: #0073aa;
    color: #fff;
}

.atms-badge-success {
    background: #28a745;
}

.atms-badge-danger {
    background: #dc3545;
}

.atms-badge-warning {
    background: #ffc107;
    color: #333;
}

/* Card */
.atms-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.atms-card-header {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.atms-card-body {
    color: #666;
}

/* Month Selector */
.atms-month-year-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.atms-month-year-selector label {
    font-weight: bold;
    color: #555;
}

/* Student List Item */
.atms-student-item {
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.atms-student-item-info {
    flex: 1;
}

.atms-student-item-actions {
    display: flex;
    gap: 10px;
}

/* Test Result Card */
.atms-result-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.atms-result-card h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
}

.atms-result-info {
    font-size: 14px;
    color: #666;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}