@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html, body {
    height: 100%;
    font-family: 'Courier New', 'Consolas', monospace;
    background: #1a2f24;
    color: #F5F5DC;
    -webkit-font-smoothing: antialiased;
  }

  body {
    background-color: #1a2f24;
    background-image: 
      radial-gradient(ellipse at 15% 50%, rgba(46, 71, 59, 0.8) 0%, transparent 60%),
      radial-gradient(ellipse at 85% 20%, rgba(46, 71, 59, 0.5) 0%, transparent 50%),
      radial-gradient(ellipse at 90% 90%, rgba(76, 175, 80, 0.04) 0%, transparent 40%),
      linear-gradient(rgba(107, 143, 113, 0.07) 1px, transparent 1px),
      linear-gradient(90deg, rgba(107, 143, 113, 0.07) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 60px 60px, 60px 60px;
    background-attachment: fixed;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cdefs%3E%3Cpattern id='circuit' x='0' y='0' width='300' height='300' patternUnits='userSpaceOnUse'%3E%3Cline x1='0' y1='30' x2='80' y2='30' stroke='%234a7a5a' stroke-width='0.5' opacity='0.15'/%3E%3Cline x1='120' y1='30' x2='300' y2='30' stroke='%234a7a5a' stroke-width='0.5' opacity='0.1'/%3E%3Cline x1='0' y1='150' x2='180' y2='150' stroke='%234a7a5a' stroke-width='0.5' opacity='0.12'/%3E%3Cline x1='220' y1='150' x2='300' y2='150' stroke='%234a7a5a' stroke-width='0.5' opacity='0.08'/%3E%3Cline x1='40' y1='270' x2='260' y2='270' stroke='%234a7a5a' stroke-width='0.5' opacity='0.1'/%3E%3Cline x1='80' y1='0' x2='80' y2='80' stroke='%234a7a5a' stroke-width='0.5' opacity='0.12'/%3E%3Cline x1='120' y1='30' x2='120' y2='150' stroke='%234a7a5a' stroke-width='0.5' opacity='0.1'/%3E%3Cline x1='220' y1='100' x2='220' y2='200' stroke='%234a7a5a' stroke-width='0.5' opacity='0.08'/%3E%3Ccircle cx='80' cy='30' r='2.5' fill='%234a7a5a' opacity='0.2'/%3E%3Ccircle cx='120' cy='30' r='2' fill='%234a7a5a' opacity='0.15'/%3E%3Ccircle cx='120' cy='150' r='2.5' fill='%234a7a5a' opacity='0.2'/%3E%3Ccircle cx='220' cy='150' r='2' fill='%234a7a5a' opacity='0.15'/%3E%3Crect x='160' y='60' width='30' height='20' rx='2' fill='none' stroke='%234a7a5a' stroke-width='0.5' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23circuit)'/%3E%3C/svg%3E");
    opacity: 0.4;
  }

  #root {
    height: 100%;
    position: relative;
    z-index: 1;
  }
}

@layer components {
  .glass-card {
    background: rgba(46, 71, 59, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .glass-card-dark {
    background: #1E3229; /* Solid dark color fallbacks */
    background: rgba(30, 50, 41, 0.95); /* High opacity */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(212, 175, 55, 0.3); /* Gold border */
    border-radius: 16px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  }

  .glass-card:hover {
    background: rgba(46, 71, 59, 0.8);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.1);
  }

  .manor-toggle {
    position: relative;
    width: 56px;
    height: 30px;
    border-radius: 15px;
    cursor: pointer;
    border: 1px solid rgba(245, 245, 220, 0.1);
    background: rgba(190, 18, 60, 0.2);
    transition: all 0.3s;
  }

  .manor-toggle.active {
    background: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
    border-color: rgba(76, 175, 80, 0.5);
  }

  .manor-toggle .knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #F5F5DC;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .manor-toggle.active .knob {
    transform: translateX(26px);
    background: #FFFFFF;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  }

  .btn-manor {
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.2s;
    border-radius: 8px;
    font-weight: 600;
  }

  .btn-manor-ghost {
    background: rgba(245, 245, 220, 0.05);
    border: 1px solid rgba(245, 245, 220, 0.2);
    color: #F5F5DC;
  }

  .btn-manor-ghost:hover {
    background: rgba(245, 245, 220, 0.15);
    border-color: #D4AF37;
    color: #FFFFFF;
  }

  .manor-input {
    background: rgba(30, 50, 41, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: #F5F5DC;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
  }
  
  .manor-input:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
  }

  .section-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.8rem;
    color: #D4AF37;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.8;
  }
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  padding: 2rem 1rem 6rem 1rem;
}
