/* Enhanced Voting System - Main CSS */
:root {
  --primary: #007bff;
  --primary-darker: #0056b3;
  --primary-lighter: #e6f2ff;
  --secondary: #6c757d;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --light: #f8f9fa;
  --dark: #343a40;
  --body-bg: #f4f4f4;
  --card-bg: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --font-main: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --transition: all 0.3s ease;
}
/* Language Switcher */
.language-switcher {
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    gap: 5px;
    z-index: 1000;
}

.login-language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
}

.language-switcher .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.language-switcher .btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Active state for language switcher */
.btn-light.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}
/* Base Styles */
body {
  font-family: var(--font-main);
  background-color: var(--body-bg);
  color: var(--dark);
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

/* Layout */
.container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-sm, .col-md, .col-lg, .col-xl {
  position: relative;
  width: 100%;
  min-height: 1px;
  padding-right: 15px;
  padding-left: 15px;
}

/* Admin Layout */
.admin-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: var(--card-bg);
  box-shadow: 2px 0 10px var(--shadow);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  transition: var(--transition);
  z-index: 1000;
}

.content {
  flex: 1;
  margin-left: 250px;
  padding: 20px;
  transition: var(--transition);
}

/* Voter Layout */
.voter-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background-color: var(--card-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.brand-logo {
  font-size: 24px;
  color: var(--primary);
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* Navigation */
.sidebar-nav {
  list-style: none;
  padding: 20px 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: var(--dark);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  background-color: var(--primary-lighter);
  color: var(--primary);
  border-left-color: var(--primary);
}

.nav-icon {
  margin-right: 15px;
  width: 20px;
  text-align: center;
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 10px var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.02);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: flex-end;
  background-color: rgba(0, 0, 0, 0.02);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  display: block;
  width: 95%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--dark);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: var(--dark);
  background-color: #fff;
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.875rem;
  color: var(--secondary);
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--border-radius);
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
}

.btn:focus, .btn:hover {
  text-decoration: none;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  color: #fff;
  background-color: var(--primary-darker);
  border-color: var(--primary-darker);
}

.btn-secondary {
  color: #fff;
  background-color: var(--secondary);
  border-color: var(--secondary);
}

.btn-success {
  color: #fff;
  background-color: var(--success);
  border-color: var(--success);
}

.btn-danger {
  color: #fff;
  background-color: var(--danger);
  border-color: var(--danger);
}

.btn-warning {
  color: #212529;
  background-color: var(--warning);
  border-color: var(--warning);
}

.btn-info {
  color: #fff;
  background-color: var(--info);
  border-color: var(--info);
}

.btn-outline {
  color: var(--secondary);
  background-color: transparent;
  border-color: var(--secondary);
}

.btn-outline:hover {
  color: #fff;
  background-color: var(--secondary);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.2rem;
}

.btn-lg {
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  line-height: 1.5;
  border-radius: 0.3rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

/* Ensure table layout is fixed */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--dark);
  border-collapse: collapse;
  table-layout: fixed;
}

/* Ensure table headers align with cells */
.table th,
.table td {
  padding: 0.75rem;
  vertical-align: middle;
  text-align: left; /* Ensure all th and td elements are left-aligned by default */
  border-top: 1px solid #dee2e6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal; /* Allow text to wrap */
}

.table thead th {
  vertical-align: middle;
  border-bottom: 2px solid #dee2e6;
  background-color: var(--primary);
  color: white;
}

/* Define exact column widths - adjust as needed */
.table th.photo-column,
.table td.photo-column {
  width: 100px; /* Reduced width for photos */
}

.table th.name-column,
.table td.name-column {
  width: 25%;
}

.table th.description-column,
.table td.description-column {
  width: 45%;
}

.table th.votes-column,
.table td.votes-column {
  width: 15%; 
  text-align: center;
}

.table th.actions-column,
.table td.actions-column {
  width: 15%;
  text-align: center;
}

/* Action buttons container */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.table tbody + tbody {
  border-top: 2px solid #dee2e6;
}

.table-sm th,
.table-sm td {
  padding: 0.3rem;
}

.table-bordered {
  border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
  color: var(--dark);
  background-color: rgba(0, 0, 0, 0.075);
}

/* Images */
.table .photo-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

/* Fixed size for candidate photos in the voting view */
.candidate-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.badge-primary {
  color: #fff;
  background-color: var(--primary);
}

.badge-secondary {
  color: #fff;
  background-color: var(--secondary);
}

.badge-success {
  color: #fff;
  background-color: var(--success);
}

.badge-danger {
  color: #fff;
  background-color: var(--danger);
}

.badge-warning {
  color: #212529;
  background-color: var(--warning);
}

.badge-info {
  color: #fff;
  background-color: var(--info);
}

/* Voting Cards */
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.candidate-card {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.candidate-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.candidate-info {
  padding: 15px;
}

.candidate-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
}

.candidate-description {
  font-size: 14px;
  color: var(--secondary);
  margin-bottom: 15px;
}

.vote-button {
  width: 100%;
  padding: 8px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.vote-button:hover {
  background-color: var(--primary-darker);
}

/* Checkboxes for Voting */
.vote-checkbox-container {
  display: flex;
  align-items: center;
  margin-top: 15px;
  position: relative;
}

.vote-checkbox {
  width: 22px;
  height: 22px;
  margin-right: 10px;
  cursor: pointer;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 2px solid var(--primary);
  border-radius: 4px;
  outline: none;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.vote-checkbox:checked {
  background-color: var(--primary);
}

.vote-checkbox:checked:after {
  content: '\2714';
  font-size: 14px;
  position: absolute;
  top: 0;
  left: 4px;
  color: white;
}

.vote-checkbox-label {
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  user-select: none;
}

/* Selected card styling */
.candidate-card.selected {
  border: 2px solid var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 123, 255, 0.2);
}

/* Confirmation Dialog */
.confirm-dialog {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.dialog-content {
  background-color: white;
  padding: 20px;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dialog-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

#selected-candidates {
  max-height: 200px;
  overflow-y: auto;
  margin: 10px 0;
  padding: 10px;
  background-color: rgba(0, 123, 255, 0.05);
  border-radius: 4px;
}

#selected-candidates div {
  padding: 5px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#selected-candidates div:last-child {
  border-bottom: none;
}

/* Stats */
.stats-card {
  display: flex;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 10px var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.stats-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  color: white;
  font-size: 24px;
}

.stats-content {
  flex: 1;
  padding: 20px;
}

.stats-value {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 5px;
}

.stats-label {
  color: var(--secondary);
  font-size: 14px;
}

.stats-primary .stats-icon { background-color: var(--primary); }
.stats-success .stats-icon { background-color: var(--success); }
.stats-warning .stats-icon { background-color: var(--warning); }
.stats-danger .stats-icon { background-color: var(--danger); }

/* Alerts */
.alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
}

.alert-heading {
  color: inherit;
}

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

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

/* File upload styling */
.file-input-container {
  position: relative;
}

.file-input-container input[type="file"] {
  padding: 10px;
}

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

.login-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 10px var(--shadow);
  padding: 30px;
}

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

.login-header i {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 10px;
}

/* Animation for thank you page */
.success-icon {
  margin-bottom: 20px;
  transform: scale(0.5);
  opacity: 0;
  transition: all 0.5s ease;
}

.success-icon.animate {
  transform: scale(1);
  opacity: 1;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.m-0 { margin: 0; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.p-3 { padding: 1rem; }
.w-100 { width: 100%; }

/* Responsive Adjustments */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    overflow: hidden;
  }


  .content {
    margin-left: 0;
  }
  
  .sidebar.show {
    width: 250px;
  }
  
  .stats-card {
    flex-direction: column;
  }
  
  .stats-icon {
    width: 100%;
    height: 80px;
  }
  
  .candidate-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 576px) {
  .login-card {
    padding: 20px;
  }
  
  .table th, 
  .table td {
    padding: 0.5rem;
  }
  
  .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
  }
}
/* Global Form Styles */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 95%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Login Page Specific Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f8f9fa;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    width: 95%;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0069d9;
    border-color: #0062cc;
}

/* File Input Styles */
.custom-file {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-file-input {
    position: relative;
    z-index: 2;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    opacity: 0;
}

.custom-file-label {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.custom-file-label::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: block;
    height: calc(1.5em + 0.75rem);
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
    color: #495057;
    content: "Browse";
    background-color: #e9ecef;
    border-left: inherit;
    border-radius: 0 0.25rem 0.25rem 0;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .login-card {
        width: 90%;
        padding: 1rem;
    }
}
/* Improved Form Layout */
.card-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 95%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Datetime and File Input Specific Styling */
input[type="datetime-local"],
input[type="file"] {
    width: 90%;
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

/* Button Styling */
.btn-primary {
    width: 95%;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Checkbox and Multiple Selection */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.form-check-input {
    margin-right: 0.5rem;
}

/* Responsive Grid for Start/End Date */
.date-container {
    display: flex;
    gap: 1rem;
}

.date-container > div {
    flex: 1;
}

/* Label Styling */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* File Input Custom Styling */
.file-input-container {
    position: relative;
    width: 100%;
}

.file-input-container input[type="file"] {
    position: absolute;
    width: 100%;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    top: 0;
    left: 0;
}

.file-input-label {
    display: block;
    width: 95%;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Add this CSS to your voter_vote.php file or to your main CSS file */

.event-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    max-width: 100%;
}

.event-logo {
    max-width: 600px;  /* Adjust this value to control the width */
    max-height: 250px; /* Adjust this value to control the height */
    width: auto;
    height: auto;
    object-fit: contain; /* This maintains the aspect ratio */
    border-radius: 8px;
}

/* For mobile devices */
@media (max-width: 768px) {
    .event-logo {
        max-width: 200px;
        max-height: 80px;
    }
}
/* Button Group */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.form-actions .btn {
    flex: 1;
}
