/* Cosmic Red Architecture Studio Theme */

/* CSS Custom Properties */
:root {
  --primary-color: #1a1a2e;
  --secondary-color: #e94560;
  --accent-color: #16213e;
  --text-light: #ffffff;
  --text-dark: #333333;
  --text-muted: #6c757d;
  --bg-dark: #0f0f1a;
  --bg-light: #f8f9fa;
  --gradient-cosmic: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  --gradient-red: linear-gradient(135deg, var(--secondary-color) 0%, #ff6b7d 100%);
  --shadow-soft: 0 4px 20px rgba(26, 26, 46, 0.1);
  --shadow-strong: 0 8px 40px rgba(26, 26, 46, 0.2);
  --border-radius: 8px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
}

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

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  font-size: 16px;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

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

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

p {
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

a {
  text-decoration: none;
  color: var(--secondary-color);
  transition: var(--transition-smooth);
}

a:hover {
  color: #ff6b7d;
  text-decoration: none;
}

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

/* Bootstrap 5 Overrides */
.btn {
  border-radius: var(--border-radius);
  font-weight: 600;
  padding: 0.75rem 2rem;
  border: none;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

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

.btn-primary:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
  color: var(--text-light);
}

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

.btn-secondary:hover {
  background: #d63447;
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
  color: var(--text-light);
}

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

.btn-outline-primary:hover {
  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 {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color: var(--text-light);
  transform: translateY(-2px);
}

.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  transition: var(--transition-smooth);
  overflow: hidden;
}

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

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

/* Navigation */
.navbar {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(233, 69, 96, 0.1);
  transition: var(--transition-smooth);
  padding: 1rem 0;
}

.navbar.scrolled {
  background: rgba(26, 26, 46, 0.98);
  padding: 0.5rem 0;
  box-shadow: var(--shadow-soft);
}

.navbar-brand {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-light);
}

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

.navbar-nav .nav-link {
  color: var(--text-light);
  font-weight: 500;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition-smooth);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--secondary-color);
  background: rgba(233, 69, 96, 0.1);
}

.navbar-toggler {
  border: 2px solid var(--secondary-color);
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(233, 69, 96, 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='%23e94560' 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: var(--gradient-cosmic);
  display: flex;
  align-items: center;
  position: relative;
  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="stars" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%23e94560" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23stars)"/></svg>') repeat;
  opacity: 0.1;
  animation: float 20s ease-in-out infinite;
}

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

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

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

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

/* 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-dark p {
  color: rgba(255, 255, 255, 0.8);
}

.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-red);
  border-radius: 2px;
}

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

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  aspect-ratio: 4/3;
  cursor: pointer;
}

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

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 26, 46, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: var(--transition-smooth);
  color: var(--text-light);
  text-align: center;
  padding: 2rem;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

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

/* Services */
.service-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: var(--text-light);
  transition: var(--transition-smooth);
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(10deg);
}

/* Team */
.team-member {
  text-align: center;
  padding: 1.5rem;
}

.team-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  overflow: hidden;
  border: 4px solid var(--secondary-color);
  transition: var(--transition-smooth);
}

.team-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(233, 69, 96, 0.3);
}

.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-links {
  margin-top: 1rem;
}

.social-links a {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: var(--text-light);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.25rem;
  transition: var(--transition-smooth);
}

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

/* Contact Form */
.form-control {
  border: 2px solid #e9ecef;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  transition: var(--transition-smooth);
  background: var(--bg-light);
}

.form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.2rem rgba(233, 69, 96, 0.25);
  background: #fff;
}

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

.invalid-feedback {
  color: var(--secondary-color);
  font-weight: 500;
}

.is-invalid .form-control {
  border-color: var(--secondary-color);
}

/* Footer */
.footer {
  background: var(--primary-color);
  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.8);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 2rem;
  padding-top: 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

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

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

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.fade-in-up.animate {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll to Top Button */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--gradient-red);
  border: none;
  border-radius: 50%;
  color: var(--text-light);
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  z-index: 1000;
}

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

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

/* 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(--text-light);
  animation: spin 0.8s ease-in-out infinite;
}

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

/* Mobile Optimizations */
@media (max-width: 768px) {
  .hero {
    min-height: 80vh;
    padding: 2rem 0;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .team-avatar {
    width: 150px;
    height: 150px;
  }
  
  .btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
  }
  
  .navbar-nav {
    background: rgba(26, 26, 46, 0.95);
    border-radius: var(--border-radius);
    margin-top: 1rem;
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  
  .portfolio-item {
    aspect-ratio: 3/2;
  }
  
  .service-card {
    padding: 2rem 1rem;
  }
  
  .scroll-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-primary {
    background: var(--primary-color);
    border: 2px solid var(--text-light);
  }
  
  .btn-secondary {
    background: var(--secondary-color);
    border: 2px solid var(--text-light);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
  
  .hero::before {
    animation: none;
  }
}