/* ========= RESET & BASE ========= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* ========= TYPOGRAPHY ========= */
h1, h2, h3, h4 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1e3c72;
}

a {
    text-decoration: none;
    color: #007bff;
    margin-right: 10px;
}

a:hover {
    text-decoration: underline;
}

/* ========= LAYOUT ========= */
.container {
    max-width: 800px;   /* matches register.php container width */
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* For wider pages (dashboards, tables) */
.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* ========= NAVIGATION BAR ========= */


.role-badge {
    background: #ffc107;
    color: #1e3c72;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ========= FORMS (matches register.php) ========= */
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.row .form-group {
    flex: 1;
    min-width: 150px;
}

/* Error box (matches register.php .error-box) */
.error-box {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.error-box p {
    margin: 0 0 5px 0;
}

/* Success / Info alerts (for later use) */
.alert-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Buttons */
button, .btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 5px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

button:hover, .btn:hover {
    background: #bacee3;
}

.btn-secondary {
    background: #e3e9ee;
    width: auto;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    width: auto;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.875rem;
    width: auto;
}

/* Link under form */
.link {
    text-align: center;
    margin-top: 20px;
}

/* Role-specific fields container */
.role-fields {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-top: 5px;
    margin-bottom: 20px;
}

hr {
    margin: 25px 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* ========= TABLES (for dashboards) ========= */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f0f2f5;
    font-weight: 600;
    color: #1e3c72;
}

tr:hover {
    background: #f9f9f9;
}

/* ========= DASHBOARD CARDS & STATS ========= */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 2rem;
    margin: 10px 0;
    color: #007bff;
}

/* ========= CLASS / ASSIGNMENT CARDS ========= */
.class-card, .assignment-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.class-card:hover, .assignment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.class-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    background: #e9ecef;
}

.class-type.live {
    background: #d4edda;
    color: #155724;
}

.class-type.recorded {
    background: #fff3cd;
    color: #856404;
}

.password-wrapper {
    position: relative;
    display: block; /* or flex, but block works */
}

.password-wrapper input {
    width: 100%;
    padding-right: 40px; /* space for the eye icon */
    box-sizing: border-box;
}

.toggle-password {
    right: 10px;   /* adjust as needed */
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

/* ========= RESPONSIVE ========= */
@media (max-width: 768px) {
    
    .row {
        flex-direction: column;
        gap: 10px;
    }
    th, td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    .container, .container-wide {
        padding: 15px;
    }
    .container {
        width: 95%;
        padding: 20px;
    }
}