/* ===================================
   Architectural Studio Theme CSS
   Dynamic Crimson & Deep Navy
   =================================== */

/* Root Variables */
:root {
  --primary-color: #E63946;
  --secondary-color: #1D3557;
  --light-gray: #F1FAEE;
  --medium-gray: #A8DADC;
  --dark-text: #1a1a1a;
  --light-text: #ffffff;
  --transition: all 0.3s ease;
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--dark-text);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Typography */
.display-1,
.display-3,
.display-4,
.display-5 {
  font-weight: 700;
  letter-spacing: -1px;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
}

/* Navbar Styles */
.navbar {
  padding: 1rem 0;
  transition: var(--transition);
  background: rgba(29, 53, 87, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar-dark {
  background: var(--secondary-color) !important;
}

.navbar-brand {
  font-size: 1.5rem;
  color: var(--light-text) !important;
  transition: var(--transition);
  letter-spacing: 1px;
}

.navbar-brand:hover {
  color: var(--primary-color) !important;
  transform: translateY(-2px);
}

.navbar-toggler {
  border-color: var(--primary-color) !important;
  padding: 0.5rem 0.75rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(230, 57, 70, 0.25);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28230, 57, 70, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  margin: 0 0.25rem;
  transition: var(--transition);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color) !important;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--secondary-color) 0%, #2a4a7a 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path fill="rgba(230,57,70,0.1)" d="M0,100 L50,120 L100,80 L150,140 L200,100 L250,130 L300,90 L350,150 L400,110 L450,140 L500,100 L550,160 L600,120 L650,180 L700,140 L750,200 L800,160 L850,220 L900,180 L950,240 L1000,200 L1050,260 L1100,220 L1150,280 L1200,240 L1200,600 L0,600 Z"/></svg>');
  background-size: cover;
  opacity: 0.3;
  animation: heroPattern 20s ease-in-out infinite;
}

@keyframes heroPattern {
  0%, 100% { transform: translateX(0) scale(1); }
  50% { transform: translateX(-50px) scale(1.05); }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(29, 53, 87, 0.8) 0%, rgba(230, 57, 70, 0.3) 100%);
  z-index: 1;
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

.hero-section .display-1 {
  font-size: 4rem;
  color: var(--light-text) !important;
  text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease;
}

.hero-section .lead {
  color: rgba(255, 255, 255, 0.95) !important;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 1.2s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons */
.btn {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 50px;
  transition: var(--transition);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: -1;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-lg {
  padding: 1rem 2.5rem !important;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: var(--light-text) !important;
}

.btn-primary:hover {
  background: #d62839 !important;
  border-color: #d62839 !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(230, 57, 70, 0.4) !important;
}

.btn-outline-primary {
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  background: transparent !important;
}

.btn-outline-primary:hover {
  background: var(--primary-color) !important;
  color: var(--light-text) !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(230, 57, 70, 0.3);
}

.btn-dark {
  background: var(--secondary-color) !important;
  border-color: var(--secondary-color) !important;
  color: var(--light-text) !important;
}

.btn-dark:hover {
  background: #152841 !important;
  border-color: #152841 !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(29, 53, 87, 0.4) !important;
}

.btn-outline-dark {
  border-color: var(--secondary-color) !important;
  color: var(--secondary-color) !important;
}

.btn-outline-dark:hover {
  background: var(--secondary-color) !important;
  color: var(--light-text) !important;
}

.btn-light {
  background: var(--light-gray) !important;
  border-color: var(--light-gray) !important;
  color: var(--secondary-color) !important;
}

.btn-light:hover {
  background: #ffffff !important;
  color: var(--primary-color) !important;
}

.btn-outline-light {
  border-color: var(--light-text) !important;
  color: var(--light-text) !important;
}

.btn-outline-light:hover {
  background: var(--light-text) !important;
  color: var(--secondary-color) !important;
}

/* Cards */
.card {
  border: none !important;
  border-radius: 20px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  height: 100%;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(230, 57, 70, 0.3);
}

.card-img-top {
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}

.card:hover .card-img-top {
  transform: scale(1.1);
}

.card-body {
  padding: 2rem;
  background: white;
}

.card-title {
  color: var(--secondary-color) !important;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card-text {
  color: #666 !important;
  line-height: 1.8;
}

/* Class Card Styles */
.class-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  height: 400px;
}

.class-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.class-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(29, 53, 87, 0.95) 0%, rgba(230, 57, 70, 0.7) 100%);
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  transition: var(--transition);
  opacity: 0;
}

.class-card:hover .class-overlay {
  opacity: 1;
}

.overlay-content {
  color: var(--light-text) !important;
}

.overlay-content h3 {
  color: var(--light-text) !important;
}

/* Hover Lift Effect */
.hover-lift {
  transition: var(--transition);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Sections */
section {
  padding: 5rem 0;
}

.py-5 {
  padding-top: 5rem !important;
  padding-bottom: 5rem !important;
}

/* Background Colors */
.bg-light {
  background: var(--light-gray) !important;
}

.bg-white {
  background: #ffffff !important;
}

.bg-primary {
  background: var(--primary-color) !important;
}

.bg-secondary {
  background: var(--secondary-color) !important;
}

/* Text Colors */
.text-primary {
  color: var(--primary-color) !important;
}

.text-secondary {
  color: var(--secondary-color) !important;
}

.text-white {
  color: var(--light-text) !important;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}

.text-muted {
  color: #6c757d !important;
}

/* Badge */
.badge {
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0.5rem 1rem !important;
}

.badge.bg-primary {
  background: var(--primary-color) !important;
  color: var(--light-text) !important;
}

.badge.bg-secondary {
  background: var(--secondary-color) !important;
  color: var(--light-text) !important;
}

.rounded-pill {
  border-radius: 50rem !important;
}

/* Images */
.img-fluid {
  max-width: 100%;
  height: auto;
  border-radius: 15px;
}

.rounded-4 {
  border-radius: 20px !important;
}

.shadow-lg {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
}

.shadow-sm {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Instructor Image */
.instructor-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-color);
}

/* Forms */
.form-control,
.form-select {
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: var(--transition);
  background: white;
  color: var(--dark-text) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.25rem rgba(230, 57, 70, 0.15) !important;
  background: white !important;
}

.form-label {
  font-weight: 600;
  color: var(--secondary-color) !important;
  margin-bottom: 0.5rem;
}

.form-check-input {
  border: 2px solid #d0d0d0;
  width: 1.25rem;
  height: 1.25rem;
}

.form-check-input:checked {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.form-check-label {
  color: var(--dark-text) !important;
  margin-left: 0.5rem;
}

.invalid-feedback {
  color: var(--primary-color) !important;
  font-weight: 500;
}

/* Alerts */
.alert {
  border-radius: 15px;
  border: none;
  padding: 1rem 1.5rem;
  font-weight: 500;
}

.alert-success {
  background: #d4edda !important;
  color: #155724 !important;
}

/* Icons */
.fas,
.fab,
.bi {
  transition: var(--transition);
}

a:hover .fas,
a:hover .fab,
a:hover .bi {
  transform: scale(1.1);
}

/* Accordion */
.accordion {
  border: none;
}

.accordion-item {
  border: none;
  margin-bottom: 1rem;
  border-radius: 15px !important;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.accordion-header {
  border: none;
}

.accordion-button {
  background: var(--light-gray) !important;
  color: var(--secondary-color) !important;
  font-weight: 600;
  border: none;
  padding: 1.25rem 1.5rem;
}

.accordion-button:not(.collapsed) {
  background: var(--primary-color) !important;
  color: var(--light-text) !important;
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border: none;
}

.accordion-button::after {
  filter: brightness(0) invert(1);
}

.accordion-body {
  padding: 1.5rem;
  background: white;
  color: #666 !important;
}

/* Table */
.table {
  border-radius: 15px;
  overflow: hidden;
}

.table-hover tbody tr {
  transition: var(--transition);
}

.table-hover tbody tr:hover {
  background-color: rgba(230, 57, 70, 0.05) !important;
  transform: scale(1.01);
}

.table thead {
  background: var(--secondary-color) !important;
  color: var(--light-text) !important;
}

.table thead th {
  border: none;
  padding: 1rem;
  font-weight: 600;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  color: var(--dark-text) !important;
}

/* Carousel */
.carousel {
  border-radius: 20px;
  overflow: hidden;
}

.carousel-item {
  height: 400px;
}

.carousel-item img {
  height: 100%;
  object-fit: cover;
}

.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(230, 57, 70, 0.8) !important;
  border-radius: 50%;
  opacity: 0.8;
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

/* Footer */
footer {
  background: var(--secondary-color) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  padding: 3rem 0 1rem;
}

footer h5,
footer h4 {
  color: var(--light-text) !important;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

footer a {
  color: rgba(255, 255, 255, 0.7) !important;
  text-decoration: none !important;
  transition: var(--transition);
  display: inline-block;
}

footer a:hover {
  color: var(--primary-color) !important;
  transform: translateX(5px);
}

footer .list-unstyled li {
  margin-bottom: 0.75rem;
}

footer .fab,
footer .fas {
  font-size: 1.5rem;
  color: var(--light-text) !important;
  transition: var(--transition);
}

footer .fab:hover,
footer .fas:hover {
  color: var(--primary-color) !important;
  transform: translateY(-3px);
}

/* Sticky Elements */
.sticky-top {
  position: sticky;
  top: 80px;
  z-index: 1020;
}

.sticky-bottom {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1030;
}

.position-fixed {
  position: fixed !important;
}

.fixed-top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
}

/* Rounded Circle */
.rounded-circle {
  border-radius: 50% !important;
}

/* Border */
.border {
  border: 1px solid #dee2e6 !important;
}

.border-bottom {
  border-bottom: 1px solid #dee2e6 !important;
}

.border-top {
  border-top: 1px solid #dee2e6 !important;
}

.border-0 {
  border: 0 !important;
}

/* Spacing Utilities */
.gap-3 {
  gap: 1rem !important;
}

.gap-4 {
  gap: 1.5rem !important;
}

.g-3 {
  gap: 1rem !important;
}

.g-4 {
  gap: 1.5rem !important;
}

.g-0 {
  gap: 0 !important;
}

/* Scroll to Top Button */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-color) !important;
  color: var(--light-text) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
  box-shadow: 0 5px 20px rgba(230, 57, 70, 0.4);
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--secondary-color) !important;
  transform: translateY(-5px);
}

/* Cookie Banner */
.cookie-banner {
  background: rgba(29, 53, 87, 0.98) !important;
  backdrop-filter: blur(10px);
  color: var(--light-text) !important;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
}

.cookie-banner p {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-fade-in {
  animation: fadeIn 1s ease;
}

.animate-slide-left {
  animation: slideInLeft 0.8s ease;
}

.animate-slide-right {
  animation: slideInRight 0.8s ease;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(230, 57, 70, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: rgba(29, 53, 87, 0.98);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
  }

  .nav-link {
    padding: 0.75rem 1rem !important;
  }

  .hero-section .display-1 {
    font-size: 2.5rem;
  }

  .display-3 {
    font-size: 2.5rem;
  }

  .display-4 {
    font-size: 2rem;
  }

  section {
    padding: 3rem 0;
  }

  .py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  .btn-lg {
    padding: 0.875rem 2rem !important;
  }
}

@media (max-width: 767.98px) {
  .hero-section .display-1 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1rem;
  }

  .card-body {
    padding: 1.5rem;
  }

  .class-card {
    height: 300px;
  }

  .scroll-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 575.98px) {
  .hero-section .display-1 {
    font-size: 1.75rem;
  }

  .display-3 {
    font-size: 2rem;
  }

  .display-4 {
    font-size: 1.75rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem !important;
    font-size: 0.9rem;
  }

  section {
    padding: 2rem 0;
  }

  .carousel-item {
    height: 250px;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  footer,
  .scroll-top {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }
}

/* Accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus Styles */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--primary-color);
  color: var(--light-text);
}

::-moz-selection {
  background: var(--primary-color);
  color: var(--light-text);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Utility Classes */
.min-vh-100 {
  min-height: 100vh !important;
}

.w-100 {
  width: 100% !important;
}

.h-100 {
  height: 100% !important;
}

.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-flex {
  display: flex !important;
}

.d-inline-block {
  display: inline-block !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.flex-grow-1 {
  flex-grow: 1 !important;
}

.align-items-center {
  align-items: center !important;
}

.align-items-start {
  align-items: flex-start !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.text-center {
  text-align: center !important;
}

.text-md-start {
  text-align: start !important;
}

.text-md-end {
  text-align: end !important;
}

.fw-bold {
  font-weight: 700 !important;
}

.fw-semibold {
  font-weight: 600 !important;
}

.fst-italic {
  font-style: italic !important;
}

.text-uppercase {
  text-transform: uppercase !important;
}

.text-decoration-none {
  text-decoration: none !important;
}

.overflow-hidden {
  overflow: hidden !important;
}

.position-relative {
  position: relative !important;
}

.position-absolute {
  position: absolute !important;
}

.top-0 {
  top: 0 !important;
}

.top-50 {
  top: 50% !important;
}

.bottom-0 {
  bottom: 0 !important;
}

.start-0 {
  left: 0 !important;
}

.start-50 {
  left: 50% !important;
}

.end-0 {
  right: 0 !important;
}

.translate-middle {
  transform: translate(-50%, -50%) !important;
}

.translate-middle-x {
  transform: translateX(-50%) !important;
}

/* Contrast and Readability Enhancements */
.text-white,
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6,
.text-white p,
.text-white a,
.text-white span {
  color: #ffffff !important;
}

.bg-primary .text-white,
.bg-secondary .text-white,
.navbar-dark .text-white {
  color: #ffffff !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Ensure all links are readable */
a {
  color: var(--primary-color) !important;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color) !important;
}

.bg-primary a,
.bg-secondary a,
footer a,
.navbar-dark a {
  color: rgba(255, 255, 255, 0.9) !important;
}

.bg-primary a:hover,
.bg-secondary a:hover,
footer a:hover,
.navbar-dark a:hover {
  color: #ffffff !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn {
    border-width: 3px;
  }

  .card {
    border: 2px solid #000;
  }

  a {
    text-decoration: underline !important;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}