/* Crimson Slate Architecture Studio Theme */

:root {
  --primary-color: #DC143C;
  --secondary-color: #2F4F4F;
  --primary-light: #E8476F;
  --primary-dark: #B8112E;
  --secondary-light: #3D6565;
  --secondary-dark: #1F3434;
  --accent-color: #F5F5F5;
  --text-dark: #212529;
  --text-light: #6C757D;
  --white: #FFFFFF;
  --black: #000000;
  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.25);
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--white);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

h3 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

h4 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

/* Bootstrap 5 Overrides */
.btn {
  border-radius: 0;
  padding: 0.75rem 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid transparent;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-smooth);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  border-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

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

.btn-outline-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-secondary {
  background: var(--gradient-secondary);
  border-color: var(--secondary-color);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  border-color: var(--secondary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(220, 20, 60, 0.1);
  transition: all var(--transition-smooth);
  padding: 1rem 0;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: var(--shadow-light);
  padding: 0.5rem 0;
}

.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition-smooth);
}

.navbar-brand:hover {
  color: var(--primary-dark);
  transform: scale(1.05);
}

.navbar-nav .nav-link {
  color: var(--text-dark);
  font-weight: 500;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all var(--transition-smooth);
  position: relative;
}

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

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

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

.navbar-toggler {
  border: none;
  padding: 4px 8px;
  outline: none;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(47, 79, 79, 0.9), rgba(220, 20, 60, 0.8)), url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%23ffffff" fill-opacity="0.05" points="0,0 1000,300 1000,1000 0,700"/></svg>');
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.hero::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 100 100"><rect width="100" height="100" fill="none" stroke="%23ffffff" stroke-width="0.1" opacity="0.1"/></svg>');
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

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

.hero h1 {
  color: var(--white);
  margin-bottom: 1.5rem;
  animation: fadeInUp 1s ease-out;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero .btn {
  animation: fadeInUp 1s ease-out 0.4s both;
}

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

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

.section:nth-child(even) {
  background: var(--accent-color);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* Cards */
.card {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  transition: all var(--transition-smooth);
  height: 100%;
  box-shadow: var(--shadow-light);
}

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

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

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

.card-body {
  padding: 2rem;
}

.card-title {
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* Portfolio Grid */
.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.portfolio-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: all var(--transition-smooth);
  z-index: 2;
}

.portfolio-item:hover::before {
  opacity: 0.8;
}

.portfolio-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--white);
  opacity: 0;
  transition: all var(--transition-smooth);
  z-index: 3;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.portfolio-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: all var(--transition-smooth);
}

.portfolio-item:hover img {
  transform: scale(1.1);
}

/* Forms */
.form-control {
  border: 2px solid #E9ECEF;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  transition: all var(--transition-smooth);
  background: var(--white);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(220, 20, 60, 0.25);
  background: var(--white);
}

.form-control.is-invalid {
  border-color: #DC3545;
}

.form-control.is-valid {
  border-color: #28A745;
}

.invalid-feedback,
.valid-feedback {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

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

/* Footer */
.footer {
  background: var(--secondary-color);
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer h5 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all var(--transition-smooth);
}

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

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin: 0 0.5rem;
  transition: all var(--transition-smooth);
}

.social-links a:hover {
  background: var(--primary-color);
  transform: translateY(-3px);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--white);
  animation: spin 1s ease-in-out infinite;
}

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

/* Scroll to Top Button */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-medium);
}

/* Mobile Styles */
@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }
  
  .hero {
    min-height: 80vh;
    text-align: center;
  }
  
  .navbar-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    margin-top: 1rem;
    border-radius: 8px;
    padding: 1rem;
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  .btn {
    padding: 0.5rem 1.5rem;
  }
  
  .scroll-top {
    bottom: 1rem;
    right: 1rem;
  }
}

@media (max-width: 576px) {
  .section {
    padding: 2rem 0;
  }
  
  .hero {
    min-height: 70vh;
    padding: 2rem 0;
  }
  
  .section-title {
    margin-bottom: 2rem;
  }
  
  .portfolio-item img {
    height: 200px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}

/* Focus Indicators */
.btn:focus,
.form-control:focus,
.nav-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #000000;
    --secondary-color: #000000;
    --text-light: #000000;
  }
}