/* Custom Variables */
:root {
    --nook-color: #198754;
    --hook-color: #0dcaf0;
    --primary-color: #0d6efd;
    --high-contrast-bg-light: #ffffff;
    --high-contrast-text-light: #000000;
    --high-contrast-bg-dark: #121212;
    --high-contrast-text-dark: #f5f5f5;
}

/* General Styles */
html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--high-contrast-bg-light);
    color: var(--high-contrast-text-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    width: 100%;
}

.card {
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #222;
    transition: transform 0.2s ease-in-out;
    min-height: auto;
    padding: 1.5rem; 
    box-sizing: border-box;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
}

/* Overview Cards */
.overview-card {
    min-height: 200px;
    background-color: transparent;
}

.total-books-card {
    border: 1.5px solid var(--primary-color) !important; /* blue */
}

.completed-tasks-card {
    border: 1.5px solid var(--nook-color) !important; /* green */
}

.reading-streak-card {
    border: 1.5px solid #ffc107 !important; /* yellow */
}

.task-streak-card {
    border: 1.5px solid var(--hook-color) !important; /* cyan */
}

/* Home Page Cards */
.nook-card {
    border: 1.5px solid var(--nook-color) !important; /* green */
}

.hook-card {
    border: 1.5px solid var(--hook-color) !important; /* cyan */
}

.nooks-club-card {
    border: 1.5px solid var(--primary-color) !important; /* blue */
}

.mini-modules-card {
    border: 1.5px solid #ffc107 !important; /* yellow */
}

/* Chart and Recent Activity Cards */
.reading-progress-card, .task-analytics-card, .recent-books-card, .recent-rewards-card {
    border: 1.5px solid var(--primary-color) !important; /* blue for consistency */
}

.card-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.5rem;
    height: 100%;
    padding: 1rem;
}

/* Taglines Section */
.taglines-section {
    margin-top: 1.5rem; /* Space below cards */
    margin-bottom: 3rem; /* Space above Quick Actions */
}

.tagline-item {
    text-align: center;
    padding: 0.75rem 0; /* Match previous card-footer padding */
}

/* Wrapper container for the cards */
.cards-container {
    margin-bottom: 4rem;
}

.cards-container .row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Align card buttons */
.card-buttons {
    display: flex !important;
    flex-direction: column;
    gap: 0.75rem !important;
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
}

.card-buttons .btn {
    width: auto;
    min-width: 160px;
    width: auto;
    white-space: nowrap;
    text-align: center;
    margin: 0;
    box-sizing: border-box;
}

/* Quick Actions Section */
.quick-actions-section {
    margin-top: 4rem; /* Adjusted for taglines section */
    margin-bottom: 3rem;
}

.quick-actions.btn {
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 20px 15px;
    color: #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 80px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.quick-actions.btn span {
    flex: 1 1 150px;
    margin: 0.25rem;
    white-space: normal;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-actions.btn:hover {
    background: var(--primary-color);
    color: white!important
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.5);
    transform: translateY(-5px);
    border-color: transparent;
}

/* Timer Styles */
.timer-display {
    font-size: 4rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.timer-controls .btn {
    min-width: 120px;
    margin: 0.5rem;
}

/* Progress Bars */
.progress {
    height: 8px;
}

/* Book Cover Styles */
.book-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

/* Theme Styles */
[data-bs-theme="dark"] {
    --bs-body-bg: var(--high-contrast-bg-dark);
    --bs-body-color: var(--high-contrast-text-dark);
}

[data-bs-theme="dark"] .card {
    color: var(--high-contrast-text-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cards-container .row, .taglines-section .row {
        display: block;
    }
    .card {
        margin: 0.5rem 0;
    }
    .tagline-item {
        margin: 0.5rem 0;
    }
    .timer-display {
        font-size: 2.5rem;
    }
    .timer-controls .btn {
        min-width: 100px;
        margin: 0.25rem;
    }
}

@media (min-width: 1200px) {
    .book-grid .card {
        max-width: 300px;
    }
    .timer-display {
        font-size: 5rem;
    }
}

/* Button Styles */
.btn-nook {
    background-color: var(--nook-color);
    border-color: var(--nook-color);
    color: white;
}

.btn-nook:hover {
    background-color: #157347;
    border-color: #146c43;
    color: white;
}

.btn-hook {
    background-color: var(--hook-color);
    border-color: var(--hook-color);
    color: black;
}

.btn-hook:hover {
    background-color: #31d2f2;
    border-color: #25cff2;
    color: black;
}

.btn-login, .btn-register {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.btn-login:hover, .btn-register:hover {
    background-color: #0b5ed7;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-login:focus, .btn-register:focus, .btn-nook:focus, .btn-hook:focus, .quick-actions.btn:focus {
    outline: 1.5px solid #0d6efd;
    outline-offset: 2px;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

/* Book Grid Improvements */
.book-grid .card {
    height: 100%;
}

.book-grid .card-img-top {
    height: 250px;
    object-fit: cover;
}

/* PWA Styles */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 0.5rem;
    z-index: 1100;
    display: none;
}

.offline .offline-indicator {
    display: block;
}

/* Card Hover Effects */
.nook-card:hover, .hook-card:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

/* Typography */
.display-1 {
    font-size: 4rem;
}

/* Outline Button Hovers */
.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white !important;
}

.btn-outline-success:hover {
    background-color: #198754;
    color: white !important;
}

.btn-outline-info:hover {
    background-color: #0dcaf0;
    color: white !important;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    color: black !important;
}

@media (max-width: 768px) {
  /* For .card-buttons layout */
  .card-buttons {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.5rem !important;
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
  }

  .card-buttons .btn {
    min-width: 120px;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    flex: 1 1 auto;
    white-space: normal;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
  }

  /* For .btn-group layout */
  .btn-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    overflow-x: hidden;
  }

  .btn-group .btn {
    flex: 1 1 48%;
    margin-bottom: 0.5rem;
    white-space: normal;
  }
}
nav[aria-label="breadcrumb"] {
    display: none;
}
.card:hover .admin-actions,
.p-2:hover .admin-actions {
  opacity: 1;
}

.password-toggle-wrapper {
  position: relative;
}
.toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  cursor: pointer;
  color: #888;
}
.admin-menu.show {
  display: block;
}
.admin-menu-btn {
  font-size: 16px;
  padding: 2px 8px;
  border-radius: 50%;
}

.admin-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #121212;
  border: 1px solid #121212;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 1000;
}

.admin-actions:hover .admin-menu {
  display: block;
}
.admin-actions {
  position: absolute;
  top: 10px;
  left: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.admin-menu button {
  display: block;
  width: 100%;
  padding: 5px 10px;
}

.admin-menu button:hover {
  background: #f8f9fa;
}

.accordion-header {
    background-color: transparent;
    padding: 15px;
    border-radius: 5px;
}

#moreHeading {
    font-size: 1.5rem;
    color: #222;
}

.accordion-header .accordion-button {
    font-weight: bold;
    color: #222;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: none;
}

.accordion-header .accordion-button:not(.collapsed) {
    background-color: #198754;
    color: white;
}
