
:root {
    --primary-color: #00e676;
    --primary-hover: #00c062;
    --danger-color: #ff3d71;
    --danger-hover: #ff004f;
    --bg-color: #f9f9f9;
    --surface-color: #ffffff;
    --text-color: #222222;
    --text-muted: #666666;
    --border-color: #eeeeee;
    --grid-dot-color: #dcdcdc;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Global Reset & Body --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    
    background-image: radial-gradient(var(--grid-dot-color) 1px, transparent 1px);
    background-size: 15px 15px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* --- Header --- */
.site-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}
.icon-logo {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}
.nav-link {
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}
.nav-link:hover {
    color: var(--text-color);
}
.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 3rem 1rem 1rem 1rem;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.hero .subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Test Area --- */
.test-container-wrapper {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem auto;
    max-width: 900px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.test-container {
    text-align: center;
}

#touch-canvas {
    width: 100%;
    height: 450px;
    background-color: #000;
    border-radius: 8px;
    cursor: crosshair;
    border: 1px solid #111;
    touch-action: none; 
}

.test-container.testing #touch-canvas {
    height: 80vh;
}

/* --- New Pill Buttons (No Icons) --- */
.controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn {
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 99px; /* Pill shape */
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.btn-primary {
    background-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--surface-color);
    color: var(--text-color);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: #fcfcfc;
    border-color: #ccc;
}

.btn-danger {
    background-color: var(--surface-color);
    color: var(--danger-color);
    border-color: var(--danger-color);
}
.btn-danger:hover {
    background-color: var(--danger-color);
    color: #fff;
}

.stats {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
#touch-count {
    font-weight: bold;
    color: var(--text-color);
}

/* --- Feature Section (New List Design) --- */
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-color);
}

.feature-section {
    padding: 3rem 0;
}

.feature-list {
    max-width: 760px; /* Constrain width for readability */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.feature-item {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.feature-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.feature-item h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
}


/* --- SEO Content Sections --- */
.content-section {
    padding-top: 2rem; /* Added padding */
}
.content-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.content-section h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.content-section p {
    margin-bottom: 1rem;
    color: #333;
}
.content-section strong {
    font-weight: 600;
    color: var(--text-color);
}

/* Icon List Style (No Icons) */
.icon-list {
    list-style: none;
    padding-left: 0;
}
.icon-list li {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}


/* --- Simple Light Footer --- */
.site-footer {
    background-color: var(--surface-color); /* Matches header */
    color: var(--text-muted);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color); /* Matches header */
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}
.site-footer p {
    margin: 0;
    font-size: 0.9rem;
}
.footer-nav {
    display: flex;
    gap: 1.5rem;
}
.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.footer-nav a:hover {
    color: var(--text-color);
}

/* Initially hide stop button */
#stop-test {
    display: none;
}

/* --- Responsive Styles (Merged) --- */

/* --- Tablet & Medium Screens --- */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }

    .test-container-wrapper {
        margin: 1rem 0 0 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .site-footer .container {
        flex-direction: column;
        gap: 1rem;
    }

    /* Fixed controls for mobile testing */
    .test-container.testing #touch-canvas {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        z-index: 100;
    }

    .test-container.testing .controls {
        position: fixed;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 101;
        background: rgba(0, 0, 0, 0.7);
        padding: 0.75rem;
        border-radius: 99px; /* Pill shape */
        width: 90%;
        box-shadow: var(--shadow-lg);
    }
    .test-container.testing .btn-secondary,
    .test-container.testing .btn-danger {
        background-color: #333;
        color: #fff;
        border-color: #555;
    }
}

/* --- Mobile Phones --- */
@media (max-width: 480px) {
    .site-header .container {
        flex-direction: column;
        gap: 0.5rem;
    }
    .nav-menu {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }
    .hero .subtitle {
        font-size: 1rem;
    }

    .controls {
        flex-direction: column; /* Stack buttons by default */
        width: 100%;
        padding: 0 1rem;
    }

    .btn {
        width: 100%;
    }
    
    /* When testing, make controls horizontal again */
    .test-container.testing .controls {
        width: 95%;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    .test-container.testing .btn {
        font-size: 1rem; /* Allow text to be readable */
        padding: 0.75rem 0.5rem; /* Adjust padding */
    }
}


/* --- Language Switcher --- */
.language-switcher {
    position: relative;
    margin-left: 1.5rem;
    width: max-content; 
}

.language-selected {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap; 
    min-width: 140px;
    justify-content: space-between;
}
.language-selected:hover,
.language-switcher.open .language-selected {
    background-color: var(--bg-color);
}

.language-selected .icon-arrow-down {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.2s ease-out;
}

.language-switcher.open .language-selected .icon-arrow-down {
    transform: rotate(180deg);
}

.language-options {
  display: none; 
  position: absolute;
  top: calc(100% + 8px);
  left: 0;  
  width: 100%; 
  min-width: 140px; /* <-- ADD THIS LINE */
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
  list-style: none;
  z-index: 100;
  
  /* --- NEW CSS FOR SCROLLING --- */
  max-height: 300px; /* Set a max height for the dropdown */
  overflow-y: auto; /* Add a scrollbar only when needed */
}

.language-switcher.open .language-options {
    display: block;
}

/* --- NEW: Custom Scrollbar Styling (Optional, but looks nice) --- */
.language-options::-webkit-scrollbar {
    width: 8px;
}
.language-options::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 8px;
}
.language-options::-webkit-scrollbar-thumb {
    background-color: var(--grid-dot-color);
    border-radius: 8px;
    border: 2px solid var(--bg-color);
}
.language-options::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}
/* --- End of new scrollbar styles --- */


.language-options li a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.language-options li a:hover {
    background-color: var(--bg-color);
}

.language-options li a.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Responsive adjustments for language switcher */
@media (max-width: 768px) {
  .site-header .container {
        /* STACK all header items */
    flex-direction: column;
        gap: 0.75rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
        position: relative; /* Keep this for child elements */
  }
    .logo {
        order: 1; /* Logo first */
    }
    .nav-menu {
        order: 2; /* Nav second */
    }
  .language-switcher {
        order: 3; /* Switcher last */
        /* Undo absolute positioning */
    position: relative; 
    top: auto;
    right: auto;
    margin-left: 0;
        width: 100%;
        max-width: 280px; /* Set a max width */
  }
    .language-selected {
        min-width: 100%; /* Make button full width */
    }
    .language-options {
        left: 0;
        right: 0;
        width: 100%; /* Make dropdown full width */
    }
}

@media (max-width: 480px) {
  /* The .site-header .container, .language-switcher, and .logo 
    rules were removed. They are now handled by the (max-width: 768px) query.
    */
  .nav-menu {
    width: 100%;
    justify-content: center;
    gap: 1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }
  .hero .subtitle {
    font-size: 1rem;
  }

  .controls {
    flex-direction: column; /* Stack buttons by default */
    width: 100%;
    padding: 0 1rem;
  }

  .btn {
    width: 100%;
   }
  
  /* When testing, make controls horizontal again */
  .test-container.testing .controls {
    width: 95%;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .test-container.testing .btn {
    font-size: 1rem; /* Allow text to be readable */
    padding: 0.75rem 0.5rem; /* Adjust padding */
  }
}

/* --- Inner Page & SEO Section Styles --- */

/* Alternating BG color for index sections */
.alt-bg {
  background-color: var(--bg-color);
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-intro {
  text-align: center;
  max-width: 700px;
  /* Use !important to override default .subtitle margin */
  margin: -2rem auto 2.5rem auto !important; 
}

/* Styles for about.php */
.page-subtitle {
  text-align: left;
  margin-top: -1rem;
  margin-bottom: 2rem;
}

.feature-section-inner {
  padding-top: 2rem;
  border-top: none;
  padding-bottom: 0; 
  border-bottom: none;
}

.container-inner {
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
}

.feature-list-inner {
  max-width: 100%;
}

.feature-item.no-border {
  border-bottom: none;
  padding-bottom: 0;
}

#about-privacy {
  padding-top: 1rem;
}
























.ad-container {
    width: 100%;
    max-width: 828px;
    margin: 1.5rem auto;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

/* Make ads scale on mobile but stay readable */
.ad-container iframe {
    width: 100% !important;
    height: 90px !important;
    border: none;
}

@media (max-width: 768px) {
    .ad-container iframe {
        transform: scale(1);
        transform-origin:  center;
    }
}

@media (max-width: 480px) {
    .ad-container iframe {
        transform: scale(0.90);
        transform-origin: center;
    }
}
