/* --- Base Reset & Global Styles --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: linear-gradient(to right, #8B0000, #BF0D3E, #FF4500);
    min-height: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: #fff;
    padding: 0;
    margin: 0;
}

/* --- Layout Wrappers --- */
.wrapper {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.wrapper.calendar-mode { max-width: 1400px; }

/* Responsive 3-Column Layout Container */
.calendar-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Typography & Header --- */
header { text-align: center; margin-bottom: 40px; animation: fadeDown 0.7s ease both; }

.header-with-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.school-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    animation: fadeDown 0.7s ease both;
}

.header-content {
    text-align: center;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,0.25);
    margin-bottom: 10px;
}

header p { font-size: 1.05rem; color: rgba(255,255,255,0.82); font-weight: 400; }

/* --- Side Columns & Center Calendar Card --- */
.announcement-display {
    flex: 0 0 250px;
    background: rgba(255,255,255,0.97); 
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 40px rgba(90,0,0,0.28);
    opacity: 0; 
}

/* FIX: Changed font color to dark red for readability */
.announcement-display h3 {
    font-family: 'Playfair Display', serif;
    color: #7b0000 !important; 
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.announcement-display p {
    color: #7b0000 !important; 
    line-height: 1.6;
    font-size: 0.98rem;
    white-space: pre-wrap;
}

.calendar-card {
    flex: 1;
    min-width: 600px;
    background: rgba(255,255,255,0.97);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 40px rgba(90,0,0,0.28);
    opacity: 0; 
    color: #7b0000;
}

/* --- Graduated Column Animations --- */
.fadeUpLeft { animation: fadeUp 0.8s ease 0.1s both; }
.fadeUpCenter { animation: fadeUp 0.8s ease 0.25s both; }
.fadeUpRight { animation: fadeUp 0.8s ease 0.4s both; }

/* Keyframes */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- FullCalendar Overrides --- */
.fc .fc-toolbar-title { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: #7b0000; }
.fc .fc-button-primary { background: #c0392b !important; border-color: #c0392b !important; }
.fc-event { background: #6a1a10 !important; border: none !important; border-radius: 6px !important; padding: 4px !important; }
.fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number { color: #7b0000 !important; font-weight: 600 !important; }
.fc .fc-day-today { background-color: #fff8eb !important; }

/* --- Global Styles --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #7b0000 0%, #c0392b 40%, #e74c3c 70%, #ff6b6b 100%);
    font-family: 'DM Sans', sans-serif;
    color: #fff;
    padding: 0;
}

/* Texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* --- Layout Wrappers --- */
.wrapper {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    padding: 48px 24px 64px;
    max-width: 1000px;
}

header { text-align: center; margin-bottom: 40px; }

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 10px;
}

header p { font-size: 1.05rem; color: rgba(255,255,255,0.82); }

/* --- Card Styling (Used in both index.php and view_times.php) --- */
.card {
    background: rgba(255,255,255,0.97);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 40px rgba(90,0,0,0.28);
    color: #7b0000;
}

/* --- Table Styles (For view_times.php) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

thead tr { background: #7b0000; color: #fff; }
th { padding: 15px; text-align: left; }
th:first-child { border-radius: 10px 0 0 10px; }
th:last-child { border-radius: 0 10px 10px 0; }

tbody td { padding: 15px; border-bottom: 1px solid #eee; }

/* card animations */
.fade-up {
    animation: fadeUp 0.8s ease both;
}

/* --- Buttons & Badges --- */
.btn-apply {
    display: inline-block;
    padding: 8px 20px;
    background: #c0392b;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
}

.btn-apply:hover { background: #96281b; }

.seats-badge {
    background: #fdecea;
    color: #c0392b;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

/* style for submit.php */
/* Centers the entire page content with the gradient background */
.wrapper.confirm-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

/* Specific card styles for the confirmation view */
.wrapper.confirm-mode .card {
    max-width: 440px; 
    width: 100%;
    padding: 40px; 
    text-align: center; 
    border-radius: 12px;
}

/* The Green Icon Box */
.icon-box {
    width: 60px;
    height: 60px;
    background: #27ae60; 
    margin: 0 auto 20px auto;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
}

/* Red style for failures */
.icon-fail {
    background: #c0392b !important; 
}

/* Summary Block */
.summary {
    background: #fcfcfc;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child { border-bottom: none; }

/* Name/Department label color */
.summary-row span:first-child { 
    color: #888; 
    font-weight: 500; 
}

/* Output value color */
.summary-row span:last-child { 
    color: #333; 
    font-weight: 600; 
}

/* Font for submit.php */
h2 { color: #7b0000; font-family: 'Playfair Display', serif; margin-bottom: 8px; }
p { color: #666; margin-bottom: 10px; }

/* Apply.php style */

/* Form Group Container */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

/* Labels */
.form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-family: 'DM Sans', sans-serif;
}

/* Inputs and Selects */
.form-group input, 
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    box-sizing: border-box; /* Ensures padding doesn't break width */
}

/* --- Date/Time Info Bar --- */
.info-bar {
    display: flex;
    justify-content: center;
    gap: 12px; /* Space between the date and time pills */
    margin-bottom: 25px; /* Space below the bar */
    border-bottom: 1px solid #f0f0f0; /* The separator line */
    padding-bottom: 20px;
}

/* Individual Pill Container */
.info-pill {
    display: flex;
    align-items: center;
    background: #fdecea; /* Light red/pink background */
    padding: 6px 12px;
    border-radius: 20px; /* Fully rounded shape */
    color: #7b0000; /* Dark red text color */
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
}

/* Specific styling for the SVG Icons */
.info-pill svg {
    width: 16px;
    height: 16px;
    margin-right: 8px; /* Space between icon and text */
    color: #7b0000; /* Dark red icon color */
}

/* Submit Button */
.btn-apply {
    width: 100%;
    padding: 15px;
    background: #7b0000;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    font-family: 'DM Sans', sans-serif;
}

/* Ensure the wrapper and card use the centering/limiting logic */
.wrapper.confirm-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.wrapper.confirm-mode .card {
    max-width: 440px;
    width: 100%;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Hover effects */
/* Highlight the day cell when hovering */
.fc-daygrid-day:hover {
    background-color: #fdf5f2; /* Light subtle tint */
    cursor: pointer;
}

/* Remove hover effect and pointer for past days */
.fc-daygrid-day.fc-day-past:hover {
    background-color: transparent;
    cursor: default;
}

/* Make past events look 'disabled' visually */
.fc-event-past {
    opacity: 0.6;
    cursor: default !important;
}

--------------------------------------


/* Admin Panel Specific Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #7b0000 0%, #c0392b 40%, #e74c3c 70%, #ff6b6b 100%);
  font-family: 'DM Sans', sans-serif;
  color: #fff;
  padding: 0;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.wrapper {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

header {
  text-align: center;
  margin-bottom: 32px;
  animation: fadeDown 0.7s ease both;
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.5px;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,0.25);
  margin-bottom: 10px;
}

header p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.82);
  font-weight: 400;
}

.toolbar {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  animation: fadeDown 0.7s ease 0.08s both;
}

.btn-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.15s;
}

.btn-dashboard:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

.btn-dashboard::before {
  content: '📋';
  font-size: 1rem;
}

.calendar-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.announcement-card {
  flex: 0 0 260px;
  background: #fff;
  border-radius: 15px;
  padding: 22px;
  color: #333;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  animation: fadeDown 0.7s ease 0.12s both;
}

.announcement-card h3 {
  color: #7b0000;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.announcement-card textarea {
  width: 100%;
  height: 150px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  resize: none;
  margin-bottom: 5px;
  color: #444;
}

/* Apply this to the container of your side panels */
.announcement-card {
    /* Existing styles... */
    
    /* Adds a soft shadow for depth */
    box-shadow: 0 15px 15px rgba(0, 0, 0, 0.1); 
    
    /* Optional: Adds a thin border for extra definition */
    border: 1px solid rgba(0, 0, 0, 0.05); 
}

.word-counter {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 12px;
  text-align: right;
}

.btn-save {
  background: #c0392b;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  width: 100%;
  transition: background 0.2s;
}
.btn-save:hover { background: #96281b; }

.calendar-card {
  flex: 1;
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 8px 40px rgba(90,0,0,0.28), 0 1px 0 rgba(255,255,255,0.12) inset;
  animation: fadeUp 0.7s ease 0.15s both;
}

.admin-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

/* FIXED: CALENDAR DATE VISIBILITY */
.fc .fc-toolbar-title { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: #7b0000; }
.fc .fc-button-primary { background: #c0392b !important; border-color: #c0392b !important; font-family: 'DM Sans', sans-serif; font-weight: 500; border-radius: 8px !important; }
.fc .fc-button-primary:hover { background: #96281b !important; border-color: #96281b !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: #7b0000 !important; border-color: #7b0000 !important; }
.fc .fc-daygrid-day:hover { background: rgba(192,57,43,0.07) !important; cursor: pointer; }
.fc .fc-day-today { background: rgba(192,57,43,0.1) !important; }

.fc .fc-col-header-cell {
    padding: 1px 0 !important; /* Decrease the '4px' to make the bar even thinner */
}

/* These lines ensure the dates are dark and visible */
/* Header day names (Sun, Mon, etc.) - Set to white for contrast */
.fc .fc-col-header-cell-cushion { 
    color: #fff !important; 
    font-weight: 600 !important; 
    text-decoration: none !important; 
}

/* Calendar date numbers - Keep these dark red */
.fc .fc-daygrid-day-number { 
    color: #7b0000 !important; 
    font-weight: 600 !important; 
    text-decoration: none !important; 
}


.fc-event { border: none !important; border-radius: 6px !important; padding: 3px 6px !important; font-family: 'DM Sans', sans-serif !important; font-size: 0.78rem !important; color: #fff !important; cursor: pointer; }
.fc-event b { font-weight: 600; display: block; }
.past-label { font-size: 0.68rem; opacity: 0.85; font-style: italic; }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

/* --- Manage Schedule Specific Styles --- */
.manage-container {
    max-width: 900px;
    margin: 40px auto;
}

.manage-card {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.manage-card h3 {
    color: #632e1e; /* Matches your header brown */
    margin-top: 0;
    margin-bottom: 20px;
}

/* Button Variants */
.btn-save {
    background-color: #632e1e;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-move {
    background-color: #4a6741; /* Green color from your screenshot */
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

/* Table Styling */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.styled-table thead {
    background-color: #632e1e;
    color: #fff;
}

.styled-table th, .styled-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

/* Ensure table text is dark and readable */
.styled-table td {
    color: #2c3e50 !important; /* A dark slate-gray for better contrast than pure black */
    font-weight: 600;          /* Slightly bolder for better legibility */
    font-size: 14px;
}

/* Force standard text for inputs to prevent browser 'blue' overrides */
input[type="time"], 
input[type="number"], 
input[type="text"] {
    color: #333 !important;
    font-weight: 500;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 4px;
}

/* Style links within the table to match your site's brown theme */
.styled-table a {
    color: #632e1e !important; 
    text-decoration: none;
    font-weight: bold;
}

/* Improve header readability */
.styled-table th {
    color: #ffffff !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
}

/* Inline form styling */
.action-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.btn-update { background-color: #d4a017; color: white; border: none; padding: 5px 10px; border-radius: 4px; }
.btn-move { background-color: #4a6741; color: white; border: none; padding: 5px 10px; border-radius: 4px; }
.btn-confirm { background-color: #4a6741; color: white; border: none; padding: 5px 10px; border-radius: 4px; margin-top: 5px; }

/* Move UI: Hidden by default */
.move-interface {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Fade-in Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Apply animation to the main wrapper */
.wrapper {
    animation: fadeIn 1.2s ease-in-out;
}

/* Dashboard container styles */
.dashboard-body { min-height: 100vh; background: #c0392b; font-family: 'DM Sans', sans-serif; color: #fff; padding: 40px 20px; }
.dashboard-wrapper { max-width: 1100px; margin: 0 auto; }

.dash-card { background: #fff; border-radius: 20px; padding: 28px; box-shadow: 0 8px 40px rgba(0,0,0,0.2); color: #333; }

/* Table styles */
.dash-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.dash-table thead tr { background: #7b0000; color: #fff; }
.dash-table th, .dash-table td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; }
.dash-table tbody tr:hover { background: #f9f9f9; }

/* Badges */
.date-badge, .students-badge, .dept-badge { font-size: 0.8rem; padding: 4px 8px; border-radius: 10px; background: #f0f0f0; }
.dash-header { text-align: center; margin-bottom: 30px; }
.dash-header h1 { font-family: 'Playfair Display', serif; }
