/* Midnight Storm Architecture Studio Theme */
/* Primary: #2C3E50, Secondary: #E74C3C */

/* ========== ROOT VARIABLES ========== */
:root {
  --primary-color: #2C3E50;
  --secondary-color: #E74C3C;
  --dark-accent: #1a252f;
  --light-accent: #34495e;
  --text-light: #ecf0f1;
  --text-dark: #2c3e50;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-700: #495057;
  --transition-base: all 0.3s ease;
  --transition-smooth: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --box-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ========== RESET & BASE STYLES ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 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-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, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
  margin-bottom: 1rem;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition-base);
}

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

/* ========== BOOTSTRAP 5 OVERRIDES ========== */
.btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0;
  border: none;
  transition: var(--transition-base);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--dark-accent);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

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

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #c0392b;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

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

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

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

.btn-outline-light:hover,
.btn-outline-light:focus {
  background-color: var(--white);
  color: var(--primary-color);
  border-color: var(--white);
}

/* ========== NAVIGATION ========== */
.navbar {
  background-color: var(--white);
  box-shadow: var(--box-shadow);
  padding: 1rem 0;
  transition: var(--transition-base);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  background-color: rgba(255, 255, 255, 0.98);
}

.navbar-brand {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 1px;
}

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

.navbar-nav .nav-link {
  color: var(--primary-color);
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  position: relative;
  transition: var(--transition-base);
}

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

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

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

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.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='%232C3E50' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ========== HERO SECTION ========== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark-accent) 0%, var(--primary-color) 50%, var(--light-accent) 100%);
  color: var(--white);
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)" /></svg>');
  opacity: 0.3;
  animation: gridMove 20s linear infinite;
}

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

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
  color: var(--white);
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  margin-bottom: 2rem;
  color: var(--text-light);
}

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

/* ========== SECTION STYLES ========== */
section {
  padding: 5rem 0;
}

.section-title {
  position: relative;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
}

.section-title.text-start::after {
  left: 0;
  transform: translateX(0);
}

/* ========== CARDS ========== */
.card {
  border: none;
  border-radius: 0;
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: var(--box-shadow);
  height: 100%;
}

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

.card-img-top {
  transition: 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.5rem;
  margin-bottom: 1rem;
}

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

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

.project-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
}

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

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(44, 62, 80, 0.95), rgba(231, 76, 60, 0.9));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-smooth);
  padding: 2rem;
}

.project-item:hover img {
  transform: scale(1.2);
}

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

.project-overlay h3 {
  color: var(--white);
  margin-bottom: 0.5rem;
}

.project-overlay p {
  color: var(--text-light);
  text-align: center;
}

/* ========== FORMS ========== */
.form-control,
.form-select {
  border: 2px solid var(--gray-300);
  border-radius: 0;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  transition: var(--transition-base);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.15);
}

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

.form-control.is-valid {
  border-color: #27ae60;
}

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

.valid-feedback {
  color: #27ae60;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

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

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* ========== FOOTER ========== */
.footer {
  background: linear-gradient(135deg, var(--dark-accent) 0%, var(--primary-color) 100%);
  color: var(--text-light);
  padding: 3rem 0 1rem;
}

.footer h5 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.footer a {
  color: var(--text-light);
  transition: var(--transition-base);
  display: inline-block;
  margin-bottom: 0.5rem;
}

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

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

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

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

/* ========== TESTIMONIALS ========== */
.testimonial-card {
  background-color: var(--gray-100);
  padding: 2rem;
  border-left: 4px solid var(--secondary-color);
  transition: var(--transition-base);
}

.testimonial-card:hover {
  background-color: var(--white);
  box-shadow: var(--box-shadow-lg);
  transform: translateX(10px);
}

.testimonial-text {
  font-style: italic;
  color: var(--gray-700);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.8;
}

.testimonial-author {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.testimonial-role {
  color: var(--gray-700);
  font-size: 0.875rem;
}

/* ========== STATISTICS ========== */
.stats-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-accent) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(231, 76, 60, 0.1) 0%, transparent 70%);
  animation: pulse 15s ease-in-out infinite;
}

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

.stat-item {
  text-align: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.stat-number {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
  display: block;
}

.stat-label {
  font-size: 1.125rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========== LOADING SPINNER ========== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--white);
  animation: spin 0.8s linear infinite;
}

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

/* ========== UTILITY CLASSES ========== */
.bg-primary-custom {
  background-color: var(--primary-color);
  color: var(--white);
}

.bg-secondary-custom {
  background-color: var(--secondary-color);
  color: var(--white);
}

.text-primary-custom {
  color: var(--primary-color);
}

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

.divider {
  height: 2px;
  background: linear-gradient(to right, transparent, var(--secondary-color), transparent);
  margin: 3rem 0;
}

/* ========== ANIMATIONS ========== */
.fade-in {
  animation: fadeIn 0.8s ease-out;
}

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

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

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

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

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

/* ========== BACK TO TOP BUTTON ========== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--secondary-color);
  color: var(--white);
  border: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-color);
  transform: translateY(-5px);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: var(--white);
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: var(--box-shadow);
  }

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

  .navbar-nav .nav-link::after {
    display: none;
  }

  section {
    padding: 3rem 0;
  }
}

@media (max-width: 767.98px) {
  .hero-section {
    min-height: 80vh;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .stats-section .row > div {
    margin-bottom: 2rem;
  }

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

@media (max-width: 575.98px) {
  .btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
  }

  .card-body {
    padding: 1.5rem;
  }

  section {
    padding: 2rem 0;
  }

  .section-title {
    margin-bottom: 2rem;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  .navbar,
  .back-to-top,
  .hero-section {
    display: none;
  }

  body {
    color: #000;
  }

  a {
    text-decoration: underline;
  }
}