/* Midnight Flare Architecture Studio Theme - CSS */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* CSS Custom Properties */
:root {
  --primary-color: #2C3E50;
  --secondary-color: #E74C3C;
  --primary-dark: #1e2b37;
  --primary-light: #34495e;
  --secondary-light: #ec7063;
  --accent-color: #f39c12;
  --text-dark: #2c3e50;
  --text-light: #ffffff;
  --text-muted: #7f8c8d;
  --bg-light: #ffffff;
  --bg-dark: #1a252f;
  --bg-section: #f8f9fa;
  --border-light: #ecf0f1;
  --shadow-light: rgba(44, 62, 80, 0.1);
  --shadow-medium: rgba(44, 62, 80, 0.15);
  --shadow-heavy: rgba(44, 62, 80, 0.25);
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, #c0392b 100%);
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 8px;
  --border-radius-lg: 12px;
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.7;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-muted);
}

/* Bootstrap 5 Overrides */
.btn {
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 2rem;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.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: var(--transition-base);
  z-index: -1;
}

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

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

.btn-primary:hover, 
.btn-primary:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(44, 62, 80, 0.3);
}

.btn-secondary {
  background: var(--gradient-secondary);
  border: 2px solid var(--secondary-color);
  color: var(--text-light);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #c0392b;
  border-color: #c0392b;
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

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

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-light);
  transform: translateY(-2px);
}

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

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color: var(--text-light);
  transform: translateY(-2px);
}

/* Card Components */
.card {
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 5px 20px var(--shadow-light);
  transition: var(--transition-base);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px var(--shadow-medium);
}

.card-header {
  background: var(--gradient-primary);
  border: none;
  color: var(--text-light);
  font-weight: 600;
}

/* Navigation */
.navbar {
  padding: 1rem 0;
  transition: var(--transition-base);
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(44, 62, 80, 0.1);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 2px 30px rgba(44, 62, 80, 0.15);
}

.navbar-brand {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color) !important;
  transition: var(--transition-base);
}

.navbar-brand:hover {
  color: var(--secondary-color) !important;
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--primary-color) !important;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--border-radius);
  transition: var(--transition-base);
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--secondary-color) !important;
  background: rgba(231, 76, 60, 0.1);
}

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

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

/* Mobile Menu Toggle */
.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
}

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

.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%2844, 62, 80, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hero Section */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--bg-dark) 100%);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero::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"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--text-light);
}

.hero h1 {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.5s forwards;
}

.hero .lead {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.7s forwards;
}

.hero .btn {
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.9s forwards;
}

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

.section-dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

.section-dark h2, 
.section-dark h3, 
.section-dark h4 {
  color: var(--text-light);
}

.section-alt {
  background: var(--bg-section);
}

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

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

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  height: 300px;
  cursor: pointer;
  transition: var(--transition-base);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  opacity: 0;
  transition: var(--transition-base);
  z-index: 1;
}

.project-card:hover::before {
  opacity: 0.8;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

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

.project-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  color: var(--text-light);
  transform: translateY(100%);
  transition: var(--transition-base);
  z-index: 2;
}

.project-card:hover .project-info {
  transform: translateY(0);
}

/* Team Section */
.team-member {
  text-align: center;
  margin-bottom: 2rem;
}

.team-member img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 4px solid var(--border-light);
  transition: var(--transition-base);
}

.team-member:hover img {
  border-color: var(--secondary-color);
  transform: scale(1.05);
}

/* Forms */
.form-control {
  border: 2px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition-base);
  background: var(--bg-light);
}

.form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
  background: var(--bg-light);
}

.form-label {
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

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

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 3rem 0 1rem;
}

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

.footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition-base);
}

.footer a:hover {
  color: var(--secondary-color);
}

.social-links a {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  margin: 0 0.5rem;
  transition: var(--transition-base);
}

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

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

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

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition-slow);
}

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

/* Loading Spinner */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-light);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: var(--transition-base);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-light);
  border-top: 3px solid var(--secondary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--gradient-secondary);
  color: var(--text-light);
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-base);
  transform: translateY(100px);
  opacity: 0;
  z-index: 1000;
}

.back-to-top.show {
  transform: translateY(0);
  opacity: 1;
}

.back-to-top:hover {
  background: #c0392b;
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(231, 76, 60, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }
  
  .hero {
    text-align: center;
    padding: 2rem 0;
  }
  
  .project-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .navbar-nav {
    padding: 1rem 0;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem !important;
    margin: 0.25rem 0;
  }
  
  .btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .card {
    margin-bottom: 1.5rem;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 1rem;
  }
  
  .section {
    padding: 2rem 0;
  }
  
  .project-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .team-member img {
    width: 150px;
    height: 150px;
  }
  
  .btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
  }
}

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

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

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

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

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

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

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

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

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.5);
    --shadow-heavy: rgba(0, 0, 0, 0.7);
  }
}