/* CSS Variables for theming - Default to light theme */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --accent-color: #0084ff;
  --panel-color: #f8f9fa;
  --link-bg: rgba(0,0,0,0.05);
  --link-hover: rgba(0,0,0,0.1);
  --border-color: rgba(0,0,0,0.1);
  --shadow-color: rgba(0, 0, 0, 0.1);
}

body.dark {
  --bg-color: #0a0a0a;
  --text-color: #ffffff;
  --accent-color: #00d4ff;
  --panel-color: #1a1a1a;
  --link-bg: rgba(255,255,255,0.1);
  --link-hover: rgba(255,255,255,0.2);
  --border-color: rgba(255,255,255,0.1);
  --shadow-color: rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  transition: all 0.3s ease;
}

/* --- HEADER STYLES (Copied from uploaded style.css) --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  /* Frosted glass effect */
  background: rgba(255, 255, 255, 0.25); /* slightly stronger tint */
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);

  /* Edge and depth shadows to simulate real glass */
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1), 
              0 1px 0 rgba(255, 255, 255, 0.2) inset;

  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0; /* keep it full-width, but you can round corners if you want */

  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;

  /* Smooth transitions for theme switch or scroll */
  transition: background 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
}

body.dark header {
  background: rgba(20, 20, 20, 0.35); /* slightly darker tint */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4), 
              0 -2px 0 rgba(255,255,255,0.05) inset;
}

.site-title {
  font-size: 1.2rem;
  font-weight: bold;
  /*color: var(--accent-color);*/
  color:#6a7389;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s;
}

nav a:hover {
  color: var(--accent-color);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#theme-toggle {
  background: var(--link-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

#theme-toggle:hover {
  background: var(--link-hover);
}

.mobile-menu-toggle {
  display: none;
  background: var(--link-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem 0.7rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.mobile-menu-toggle:hover {
  background: var(--link-hover);
}

/* Mobile Navigation - Hidden by default */
@media (max-width: 768px) {
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel-color);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  }

  nav.show {
    display: flex;
  }
  
  nav a {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-color);
  }

  nav a:last-child {
    border-bottom: none;
  }

  .mobile-menu-toggle {
    display: block;
  }
}
/* --- END HEADER STYLES --- */


/* --- Aspect Ratio Calculator Styles --- */

/* Main container structure */
.ratio-main {
  padding: 120px 2rem 2rem;
  min-height: calc(100vh - 200px); /* Adjusted for footer space */
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Align to top after header */
}

.ratio-container {
  background: var(--panel-color);
  border-radius: 1.5rem;
  border: 1px solid var(--border-color);
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 10px 30px var(--shadow-color);
  transition: all 0.3s ease;
}

/* Typography */
h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, var(--accent-color), #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  font-weight: 800;
}

.subtitle {
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  text-align: center;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 1rem;
}

/* Input Grid */
.input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.input-panel {
  padding: 1.5rem;
  background: var(--link-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.input-panel h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-color);
}

.accent-panel {
  border: 2px solid var(--accent-color);
  box-shadow: 0 4px 15px rgba(0, 132, 255, 0.2);
}

/* Form Elements */
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  opacity: 0.8;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
}

.ratio-input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.ratio-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 132, 255, 0.3);
}

.ratio-input.error {
    border-color: #ff4757 !important;
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.3);
}

.result-input {
    background: #4caf501a; /* Light green/teal background */
    color: #4CAF50; /* Green text */
    font-weight: 700;
    border: 1px solid #4CAF50;
}

/* --- Scale Button Styles (FIXED DEFAULT LOOK) --- */
.scale-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    text-align: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 1.5rem;
}

.scale-buttons {
    display: flex;
    justify-content: space-around;
    gap: 0.5rem;
}

.scale-btn {
    flex-grow: 1;
    background: var(--link-bg); /* Neutral base background for ALL scale buttons */
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.7rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: none;
    text-shadow: none;
}

.scale-btn:hover {
    background: var(--link-hover);
    color: var(--text-color);
}

.scale-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- ACTIVE STATE HIGHLIGHTING --- */
.active-preset {
    /* Applies to Ratio Presets and Scale Buttons */
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: var(--bg-color) !important;
    font-weight: 700;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 132, 255, 0.5);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}


/* --- Popular Ratios Presets List Styling --- */
.ratio-presets-visible {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.ratio-presets-visible h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.presets-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.presets-list button {
    background: var(--link-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.presets-list button:hover {
    background: var(--link-hover);
    border-color: var(--accent-color);
    color: var(--accent-color);
}


/* --- Aspect Ratio Visual Box --- */
.ratio-visual-section {
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.visual-box-wrapper {
    /* Set a max constraint for the visual box */
    max-width: 300px; 
    margin: 0 auto;
}

.aspect-ratio-box {
    position: relative; 
    width: 100%;
    overflow: hidden; 
    background: linear-gradient(135deg, var(--panel-color), var(--link-bg));
    border-radius: 1rem;
    border: 3px dashed var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 132, 255, 0.1);
    transition: all 0.3s ease;
}

.box-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.05); /* Slight overlay for contrast */
}

body.dark .box-content {
    background: rgba(255, 255, 255, 0.05);
}

.ratio-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.ratio-main-text {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-color);
    line-height: 1;
}

.ratio-sub-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Resolution Indicator */
.resolution-indicator {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    text-align: center;
}

/* Information Box */
.ratio-info {
    padding: 1.5rem;
    background: var(--link-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    margin-top: 2rem;
    text-align: left;
}

.ratio-info h2 {
    font-size: 1.4rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-weight: 700;
    text-align: left;
}

.ratio-info h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.ratio-info p, .ratio-info li {
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.ratio-info ul {
    list-style-position: inside;
    padding-left: 1rem;
}

/* --- FOOTER STYLES (Copied from uploaded style.css) --- */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
  z-index: 10;
  position: relative;
}

footer nav {
  justify-content: center;
  margin-bottom: 1rem;
}

footer nav a {
    font-size: 0.9rem;
}

footer p {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* --- Responsive Adjustments --- */
@media (min-width: 600px) {
  .input-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .ratio-main {
    padding: 100px 1rem 1rem;
  }

  .ratio-container {
    padding: 1.5rem;
    border-radius: 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .ratio-main-text {
      font-size: 2rem;
  }
}



