/* =========================================
   1. GLOBAL STYLES
   ========================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f6f9; /* Default Dashboard Background */
    color: #333;
}

a { text-decoration: none; }

/* =========================================
   2. LOGIN & REGISTRATION PAGES
   ========================================= */
/* This class is used on the <body> tag of index.php and register.php */
.auth-bg {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* Blue Gradient */
    margin: 0;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    width: 350px;
    text-align: center;
}

.auth-container h2 {
    color: #333;
    margin-bottom: 20px;
    margin-top: 0;
}

.auth-container .link-text {
    margin-top: 20px;
    font-size: 14px;
}

.auth-container a {
    color: #3498db;
    font-weight: bold;
}

/* =========================================
   3. DASHBOARD LAYOUT (Admin, Teacher, Student)
   ========================================= */
/* Navbar */
nav {
    background: #2c3e50;
    color: white;
    padding: 0 40px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav h1 { font-size: 22px; margin: 0; }
nav a { color: #ecf0f1; font-weight: bold; transition: color 0.2s; }
nav a:hover { color: #3498db; }

/* Main Container */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.table-container {
    max-width: 1200px;
    margin: 0 auto 50px auto;
    padding: 0 20px;
}

/* White Cards for Forms */
.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 300px;
}

.card h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 15px;
    font-size: 20px;
}

/* =========================================
   4. FORMS & INPUTS (Global)
   ========================================= */
label {
    display: block;
    margin-top: 15px;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    text-align: left; /* Ensures left alignment in centered login box */
}

input, select {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    margin-bottom: 10px; /* Spacing between inputs */
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    background: #fafafa;
}

input:focus, select:focus {
    border-color: #3498db;
    background: white;
    outline: none;
}

button {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: #3498db; /* Default Blue */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover { background: #2980b9; }

/* Specific Button Colors */
.btn-green { background: #27ae60; }
.btn-green:hover { background: #219150; }
.btn-orange { background: #f39c12; }

/* Status Messages */
.error { color: red; background: #ffeaea; padding: 10px; border-radius: 5px; margin-bottom: 15px; border: 1px solid #f5c6cb; }
.success-msg { background: #d4edda; color: #155724; padding: 10px; border-radius: 5px; margin-bottom: 15px; border: 1px solid #c3e6cb; }
.error-msg { background: #f8d7da; color: #721c24; padding: 10px; border-radius: 5px; margin-bottom: 15px; border: 1px solid #f5c6cb; }


/* =========================================
   5. MODERN TABLES (FIXED)
   ========================================= */

/* The Container for the Table Card */
.table-container {
    max-width: 1200px;
    margin: 40px auto 60px auto; /* Centered with space at bottom */
    padding: 0 20px;
}

/* Ensure the card holding the table doesn't have default padding 
   so the green header touches the edges */
.table-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden; /* Clips the table corners to match card */
}

.table-card h2 {
    margin: 0;
    padding: 20px;
    background: white;
    color: #2c3e50;
    font-size: 20px;
    border-bottom: none;
}

/* The Table Itself */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    text-align: left;
}

.styled-table thead tr {
    background-color: #009879; /* Teal Green Header */
    color: #ffffff;
    text-align: left;
    font-weight: bold;
}

.styled-table th, 
.styled-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #dddddd;
}

/* Row Styling */
.styled-table tbody tr:nth-of-type(even) {
    background-color: #f9f9f9; /* Light gray zebra stripe */
}

.styled-table tbody tr:last-of-type {
    border-bottom: 3px solid #009879; /* Bottom green border */
}

.styled-table tbody tr:hover {
    background-color: #f1f1f1; /* Hover effect */
}

/* Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-course { background-color: #e3f2fd; color: #1565c0; }
.badge-year { background-color: #fff3e0; color: #ef6c00; }

/* Remove Button */
.btn-remove {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}
.btn-remove:hover {
    background-color: #c62828;
    color: white;
    border-color: #c62828;
}