/* =============  COLOR VARIABLES  ============= */
:root {
  /* Dark mode color palette (default) */
  --color-bg-dark: #1c1c1c;
  --color-bg-darker: #0d0d0d;
  --color-bg-section: rgba(24, 24, 24, 0.22);
  --color-bg-input: rgba(24, 24, 24, 0.18);
  --color-bg-input-focus: rgba(24, 24, 24, 0.28);
  --color-bg-button: rgba(255, 43, 43, 0.12);
  --color-red-primary: #ff2b2b;
  --color-red-shadow: rgba(255,43,43, 0.13);
  --color-red-inset: #ff2b2b40;
  --color-red-focus: #ff2b2b60;
  --color-red-button-shadow: #ff2b2b30;
  --color-red-button-hover: #ff2b2b60;
  --color-red-text-shadow: #ff2b2b22;
  --color-red-input-shadow: #ff2b2b18;
  --color-white: #fff;
  --color-transparent: transparent;
  --color-text-primary: #fff;
  --color-text-input: #fff;
}

/* Light mode color palette */
[data-theme="light"] {
  --color-bg-dark: #f8f9fa;
  --color-bg-darker: #ffffff;
  --color-bg-section: rgba(255, 255, 255, 0.85);
  --color-bg-input: rgba(248, 249, 250, 0.9);
  --color-bg-input-focus: rgba(240, 248, 255, 0.95);
  --color-bg-button: rgba(0, 128, 255, 0.12);
  --color-red-primary: #0080ff;
  --color-red-shadow: rgba(0, 128, 255, 0.15);
  --color-red-inset: rgba(0, 128, 255, 0.25);
  --color-red-focus: rgba(0, 128, 255, 0.4);
  --color-red-button-shadow: rgba(0, 128, 255, 0.3);
  --color-red-button-hover: rgba(0, 128, 255, 0.6);
  --color-red-text-shadow: rgba(0, 128, 255, 0.2);
  --color-red-input-shadow: rgba(0, 128, 255, 0.1);
  --color-white: #2c3e50;
  --color-text-primary: #2c3e50;
  --color-text-input: #2c3e50;
}

body {
  background: radial-gradient(circle at center, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  transition: background 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.contact-section {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.contact-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 700px;              /* Reduced from 820px for better fit */
  max-height: 90vh;              /* Limit height to 90% of viewport */
  background: var(--color-bg-section);
  border-radius: 32px;
  border: 2.5px solid var(--color-red-primary);
  box-shadow:
    0 8px 40px 0 var(--color-red-shadow),
    0 2px 32px 0 var(--color-red-shadow),
    0 0 0 2px var(--color-red-inset) inset;
  overflow: hidden;
  backdrop-filter: blur(22px) saturate(1.2);
  transition: box-shadow 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), border-color 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), background 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-sizing: border-box;
}

.contact-image {
  display: none; /* Hide image for a cleaner, modern look */
}

.contact-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--color-transparent);
  backdrop-filter: none;
  box-sizing: border-box;
  overflow-y: auto;              /* Allow scrolling if needed */
}

.contact-container h2 {
  color: var(--color-red-primary);
  margin-bottom: 25px;           /* Reduced margin */
  text-align: center;
  font-size: 2.2rem;             /* Slightly smaller heading */
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 12px var(--color-red-text-shadow);
  transition: color 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), text-shadow 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.form-group {
  margin-bottom: 18px;           /* Slightly reduced spacing */
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  color: var(--color-red-primary);
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 1.15rem;            /* Larger label */
  transition: color 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px 16px;            /* Slightly reduced padding */
  border: 1.5px solid var(--color-red-primary);
  border-radius: 10px;
  background: var(--color-bg-input);
  color: var(--color-text-input);
  font-size: 1.1rem;             /* Slightly smaller input text */
  transition: border 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), background 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
  resize: none;
  outline: none;
  box-shadow: 0 1.5px 8px var(--color-red-input-shadow);
  backdrop-filter: blur(6px);
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-red-primary);
  background: var(--color-bg-input-focus);
  box-shadow: 0 0 0 2px var(--color-red-focus);
}

button[type="submit"] {
  background: var(--color-bg-button);
  color: var(--color-red-primary);
  padding: 15px 0;               /* Reduced padding */
  width: 100%;
  border: 2px solid var(--color-red-primary);
  border-radius: 14px;
  font-size: 1.15rem;            /* Slightly smaller button text */
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), border-color 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
  margin-top: 8px;               /* Reduced margin */
  box-shadow: 0 2px 10px var(--color-red-button-shadow);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}

button[type="submit"]:hover {
  background: var(--color-red-primary);
  color: white;
  box-shadow: 0 4px 18px var(--color-red-button-hover);
}

/* Light mode specific enhancements */
[data-theme="light"] .contact-wrapper {
  border: 2.5px solid var(--color-red-primary);
  box-shadow:
    0 8px 40px 0 var(--color-red-shadow),
    0 2px 32px 0 var(--color-red-shadow),
    0 0 0 2px var(--color-red-inset) inset,
    0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .form-group input::placeholder,
[data-theme="light"] .form-group textarea::placeholder {
  color: #6c757d;
  opacity: 0.7;
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group textarea:focus {
  box-shadow: 
    0 0 0 2px var(--color-red-focus),
    0 2px 10px rgba(0, 128, 255, 0.1);
}

/* Desktop-specific adjustments */
@media (min-width: 1200px) {
  .contact-wrapper {
    max-width: 750px;
  }
  .contact-container {
    padding: 45px 60px 40px 60px;
  }
}

@media (min-width: 901px) and (max-width: 1199px) {
  .contact-wrapper {
    max-width: 650px;
  }
  .contact-container {
    padding: 40px 45px 35px 45px;
  }
}

/* Message styling for better visibility */
.form-message {
  padding: 12px 16px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-align: center !important;
  animation: slideDown 0.3s ease-out !important;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .contact-wrapper {
    max-width: 98vw;
    border-radius: 22px;
  }
  .contact-container {
    padding: 32px 4vw 24px 4vw;
  }
}

@media (max-width: 700px) {
  .contact-wrapper {
    max-width: 98vw;
    margin: 18px 1vw;
    border-radius: 18px;
  }
  .contact-container {
    padding: 28px 4vw 22px 4vw;
  }
  .contact-container h2 {
    font-size: 1.6rem;
  }
  .form-group label,
  .form-group input,
  .form-group textarea,
  button[type="submit"] {
    font-size: 1rem;
  }
  button[type="submit"] {
    padding: 13px 0;
  }
}
