/* Crimson Force Architecture Studio - Custom Styles */

:root {
  --primary-color: #D32F2F;
  --secondary-color: #212121;
  --light-bg: #f8f9fa;
  --dark-bg: #121212;
  --text-light: #ffffff;
  --text-dark: #333333;
  --transition-speed: 0.3s;
  --shadow-sm: 0 2px 4px rgba(211, 47, 47, 0.1);
  --shadow-md: 0 4px 8px rgba(211, 47, 47, 0.15);
  --shadow-lg: 0 8px 16px rgba(211, 47, 47, 0.2);
}

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

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

/* Typography */
.display-1, .display-3, .display-4, .display-5 {
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--text-dark) !important;
}

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

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

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

/* Navigation */
.navbar {
  padding: 1rem 0;
  transition: all var(--transition-speed) ease;
  background: linear-gradient(135deg, var(--primary-color) 0%, #B71C1C 100%) !important;
}

.navbar.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--shadow-md);
}

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

.navbar-brand {
  font-size: 1.5rem;
  color: var(--text-light) !important;
  transition: transform var(--transition-speed) ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

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

.navbar-toggler {
  border: 2px solid var(--text-light) !important;
  padding: 0.5rem 0.75rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 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%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav {
  gap: 0.5rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 4px;
  transition: all var(--transition-speed) ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-light) !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-2px);
}

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

/* Hero Section */
.position-relative.vh-100 {
  background: linear-gradient(135deg, #1a1a1a 0%, var(--secondary-color) 50%, #000000 100%);
  overflow: hidden;
}

.position-relative.vh-100::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><line x1="0" y1="50" x2="100" y2="50" stroke="%23D32F2F" stroke-width="0.1" opacity="0.2"/><line x1="50" y1="0" x2="50" y2="100" stroke="%23D32F2F" stroke-width="0.1" opacity="0.2"/></svg>');
  background-size: 50px 50px;
  opacity: 0.3;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

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

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all var(--transition-speed) ease;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.btn-sm {
  padding: 0.5rem 1rem !important;
  font-size: 0.875rem;
}

.pulse-btn {
  background: var(--primary-color) !important;
  color: var(--text-light) !important;
  box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7);
  animation: pulse 2s infinite;
  position: relative;
  overflow: hidden;
}

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

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

.pulse-btn:hover {
  background: #B71C1C !important;
  color: var(--text-light) !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(211, 47, 47, 0.4);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(211, 47, 47, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
  }
}

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

.btn-light:hover {
  background-color: transparent !important;
  color: var(--text-light) !important;
  border-color: var(--text-light) !important;
  transform: translateY(-3px);
}

.btn-outline-light {
  border: 2px solid var(--text-light) !important;
  color: var(--text-light) !important;
  background-color: transparent !important;
}

.btn-outline-light:hover {
  background-color: var(--text-light) !important;
  color: var(--primary-color) !important;
  transform: translateY(-3px);
}

.btn-outline-dark {
  border: 2px solid var(--secondary-color) !important;
  color: var(--secondary-color) !important;
  background-color: transparent !important;
}

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

.filter-btn {
  padding: 0.5rem 1.5rem;
  margin: 0.25rem;
}

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

/* Cards */
.card {
  border-radius: 12px;
  overflow: hidden;
  transition: all var(--transition-speed) ease;
  border: none !important;
  background: var(--text-light);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg) !important;
}

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

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

.card-body {
  padding: 1.5rem;
}

.card-text {
  color: var(--text-dark);
  line-height: 1.8;
}

.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

.shadow {
  box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

/* Team Cards */
.team-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  height: 400px;
}

.team-card img {
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
}

.team-card:hover img {
  transform: scale(1.15);
}

.team-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(211, 47, 47, 0.95), transparent);
  transform: translateY(70%);
  transition: transform 0.4s ease;
  color: var(--text-light) !important;
}

.team-card:hover .team-overlay {
  transform: translateY(0);
}

/* Class/Flip Cards */
.class-card {
  perspective: 1000px;
  height: 350px;
}

.flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.class-card:hover .flip-card {
  transform: rotateY(180deg);
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}

.flip-card-front {
  background: linear-gradient(135deg, var(--primary-color), #B71C1C);
  color: var(--text-light) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.flip-card-back {
  background: var(--secondary-color);
  color: var(--text-light) !important;
  transform: rotateY(180deg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Badges */
.badge {
  padding: 0.5rem 1rem;
  font-weight: 600;
  border-radius: 20px;
  background-color: var(--primary-color) !important;
  color: var(--text-light) !important;
}

.achievement-badge {
  background: linear-gradient(135deg, var(--primary-color), #B71C1C) !important;
  color: var(--text-light) !important;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed) ease;
}

.achievement-badge:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

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

/* Timeline */
.timeline-container {
  position: relative;
  padding-left: 2rem;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary-color), transparent);
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 2rem;
}

.timeline-marker {
  position: absolute;
  left: -0.5rem;
  top: 0;
  width: 1rem;
  height: 1rem;
  background-color: var(--primary-color);
  border: 3px solid var(--text-light);
  box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.2);
}

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

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(211, 47, 47, 0.25);
  outline: none;
}

.form-label {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

/* Accordion */
.accordion {
  border-radius: 12px;
  overflow: hidden;
}

.accordion-item {
  border: none !important;
  border-bottom: 1px solid #e0e0e0 !important;
  background-color: var(--text-light);
}

.accordion-header {
  margin-bottom: 0;
}

.accordion-button {
  background-color: var(--light-bg) !important;
  color: var(--text-dark) !important;
  font-weight: 600;
  padding: 1.25rem 1.5rem;
  border: none;
  transition: all var(--transition-speed) ease;
}

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

.accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(211, 47, 47, 0.25);
  border-color: var(--primary-color);
}

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

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

.accordion-body {
  padding: 1.5rem;
  color: var(--text-dark);
  background-color: var(--text-light);
}

.accordion-collapse {
  border: none;
}

/* Alerts */
.alert {
  border-radius: 8px;
  border: none;
  padding: 1rem 1.5rem;
}

/* List Group */
.list-group {
  border-radius: 12px;
  overflow: hidden;
}

.list-group-item {
  border: none !important;
  border-bottom: 1px solid #e0e0e0 !important;
  padding: 1rem 1.5rem;
  transition: all var(--transition-speed) ease;
  background-color: var(--text-light) !important;
  color: var(--text-dark) !important;
}

.list-group-item:last-child {
  border-bottom: none !important;
}

.list-group-item-action:hover {
  background-color: var(--light-bg) !important;
  color: var(--primary-color) !important;
  transform: translateX(5px);
}

.list-group-item.active {
  background-color: var(--primary-color) !important;
  color: var(--text-light) !important;
  border-color: var(--primary-color) !important;
}

.list-group-flush .list-group-item {
  border-width: 0 0 1px;
}

.list-unstyled {
  list-style: none;
  padding-left: 0;
}

/* Masonry Grid */
.masonry-grid {
  column-count: 3;
  column-gap: 1.5rem;
}

.masonry-grid > * {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

@media (max-width: 991px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (max-width: 576px) {
  .masonry-grid {
    column-count: 1;
  }
}

/* Chat Widget */
.position-fixed {
  position: fixed !important;
  bottom: 2rem;
  right: 2rem;
  z-index: 1050;
}

.card-header {
  background-color: var(--primary-color) !important;
  color: var(--text-light) !important;
  font-weight: 600;
  padding: 1rem 1.5rem;
  border-bottom: none;
}

.btn-close,
.btn-close-white {
  filter: brightness(0) invert(1);
  opacity: 1;
}

.btn-close:hover {
  opacity: 0.75;
}

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

.position-sticky {
  position: sticky !important;
  top: 100px;
}

/* Background Colors */
.bg-dark {
  background-color: var(--secondary-color) !important;
}

/* Ratio (Responsive Embeds) */
.ratio {
  position: relative;
  width: 100%;
}

.ratio::before {
  display: block;
  padding-top: var(--bs-aspect-ratio);
  content: "";
}

.ratio > * {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ratio-16x9 {
  --bs-aspect-ratio: 56.25%;
}

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

.fa-2x {
  font-size: 2em;
}

.bi {
  vertical-align: -0.125em;
}

/* Utility Classes */
.rounded {
  border-radius: 8px !important;
}

.rounded-circle {
  border-radius: 50% !important;
}

.object-fit-cover {
  object-fit: cover;
}

.img-fluid {
  max-width: 100%;
  height: auto;
}

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

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

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

/* Spacing Utilities */
.gap-2 {
  gap: 0.5rem !important;
}

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

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

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@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);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

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

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

/* Scroll Animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.scroll-animate.active {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
footer {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #000000 100%);
  color: var(--text-light) !important;
  padding: 4rem 0 2rem;
}

footer a {
  color: rgba(255, 255, 255, 0.8) !important;
  transition: all var(--transition-speed) ease;
}

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

footer .small {
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: rgba(33, 33, 33, 0.95);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
  }
  
  .display-1 {
    font-size: 3rem !important;
  }
  
  .display-3 {
    font-size: 2.5rem !important;
  }
  
  .display-4 {
    font-size: 2rem !important;
  }
  
  .vh-100 {
    height: auto !important;
    min-height: 100vh;
    padding: 6rem 0 3rem;
  }
}

@media (max-width: 767.98px) {
  .display-1 {
    font-size: 2.5rem !important;
  }
  
  .display-3 {
    font-size: 2rem !important;
  }
  
  .display-4 {
    font-size: 1.75rem !important;
  }
  
  .lead {
    font-size: 1rem !important;
  }
  
  .btn-lg {
    padding: 0.75rem 2rem !important;
  }
  
  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  .timeline-container {
    padding-left: 1.5rem;
  }
  
  .team-card {
    height: 300px;
  }
}

@media (max-width: 575.98px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .p-5 {
    padding: 2rem !important;
  }
  
  .px-5 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
  
  .position-fixed {
    bottom: 1rem;
    right: 1rem;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  footer,
  .position-fixed {
    display: none !important;
  }
  
  body {
    color: #000;
  }
  
  .card {
    break-inside: avoid;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --light-bg: #1a1a1a;
    --text-dark: #e0e0e0;
  }
}

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

*:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #B71C1C;
}

/* Loading States */
.loading {
  pointer-events: none;
  opacity: 0.6;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Hover Effects */
.hover-lift {
  transition: transform var(--transition-speed) ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
}

/* Section Padding */
section {
  padding: 5rem 0;
}

@media (max-width: 767.98px) {
  section {
    padding: 3rem 0;
  }
}