/* --- Root & Theming --- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Source+Sans+Pro:wght@400;600&display=swap');

:root {
    --primary-color-rgb: 173, 112, 255;
    --primary-color: rgb(var(--primary-color-rgb));
    --background-color: #1a1a1a;
    --surface-color: #242424;
    --on-surface-color: #e8e8e8;
    --on-primary-color: #000000;
    --font-family-body: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-family-heading: 'Merriweather', serif;
    --shadow-color: rgba(0, 0, 0, 0.6);
    --highlight-glow: 0 0 15px rgba(var(--primary-color-rgb), 0.5);
    --noise-texture: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJub2lzZSI+PGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuNzUiIG51bU9jdGF2ZXM9IjMiIHN0aXRjaFRpbGVzPSJzdGl0Y2giLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWx0ZXI9InVybCgjam9pc2UpIiBvcGFjaXR5PSIwLjAyMiIvPjwvc3ZnPg==');
}

body[data-theme="light"] {
    --primary-color-rgb: 81, 4, 182;
    --primary-color: rgb(var(--primary-color-rgb));
    --background-color: #f2f2f7;
    --surface-color: #ffffff;
    --on-surface-color: #222222;
    --on-primary-color: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --highlight-glow: 0 0 15px rgba(var(--primary-color-rgb), 0.3);
}

/* --- Base & Typography --- */
body {
    background-color: var(--background-color);
    color: var(--on-surface-color);
    font-family: var(--font-family-body);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    background-image: var(--noise-texture);
    z-index: 1000;
}

h1, h2, h3, h4, .nav-logo {
    font-family: var(--font-family-heading);
    color: var(--primary-color);
    font-weight: 700;
}

h1 { font-size: 2.8rem; letter-spacing: -1px; margin-bottom: 0.5rem;}
.page-content h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

p { line-height: 1.7; }

/* --- Header & Navigation --- */
.site-header {
    width: 100%;
    background-color: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(var(--primary-color-rgb), 0.1);
    padding: 0 2rem;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 10;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 960px;
    margin: 0 auto;
    height: 4.5rem;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-logo {
    font-size: 1.6rem;
    text-decoration: none;
    transition: color 0.3s;
}
.nav-logo:hover {
    color: var(--on-surface-color);
}

.main-nav ul {
    list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--on-surface-color);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.main-nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}


/* --- Theme & Language Switchers --- */
.theme-switcher { position: relative; display: inline-block; width: 50px; height: 28px; }
.theme-switcher input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--surface-color); border: 1px solid var(--primary-color); transition: .4s; border-radius: 28px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: var(--primary-color); transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(22px); background-color: var(--surface-color); }

.language-switcher {
    position: relative;
}

.language-switcher select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    color: var(--on-surface-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 0.4rem 2rem 0.4rem 0.8rem; /* space for icon */
    font-family: var(--font-family-body);
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.language-switcher select:hover {
    box-shadow: var(--highlight-glow);
}

.language-switcher::after {
    content: '▼';
    font-size: 0.8rem;
    color: var(--primary-color);
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* --- Main Content & Containers --- */
.container {
    width: 90%;
    max-width: 700px;
    padding: 2rem;
    box-sizing: border-box;
    margin: 2rem 0;
}

.main-container, .page-content {
    background-color: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow-color), 0 16px 60px var(--shadow-color);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.page-content { text-align: left; }
.page-content p { margin-bottom: 1.2rem; }
.subtitle { opacity: 0.8; margin-top: 0; }

/* --- Forms & Buttons --- */
.input-container {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

#url-input, .form-container input, .form-container textarea {
    flex-grow: 1;
    padding: 1rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background-color: var(--background-color);
    color: var(--on-surface-color);
    font-size: 1rem;
    font-family: var(--font-family-body);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    transition: border-color 0.3s, box-shadow 0.3s;
}

#url-input:focus, .form-container input:focus, .form-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), var(--highlight-glow);
}

#analyze-button, .form-button, .read-more-btn {
    position: relative;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(145deg, rgb(var(--primary-color-rgb)), rgba(var(--primary-color-rgb), 0.7));
    color: var(--on-primary-color) !important; /* !important to override link color */
    font-size: 1.1rem;
    font-family: var(--font-family-body);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 10px -4px rgba(var(--primary-color-rgb), 0.7), 0 2px 5px rgba(0,0,0,0.3);
}

.read-more-btn { padding: 0.6rem 1.2rem; font-size: 0.9rem; }

#analyze-button:hover, .form-button:hover, .read-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px -4px rgba(var(--primary-color-rgb), 0.6), 0 4px 8px rgba(0,0,0,0.3);
}
#analyze-button:disabled {
    cursor: not-allowed;
    background: #555;
    box-shadow: none;
}
#analyze-button.loading::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    top: 50%; left: 50%;
    margin-left: -10px; margin-top: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #000; /* Black spinner on button */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#analyze-button.loading .button-text {
    visibility: hidden;
}

/* --- Blog/Report Styles --- */
.blog-list .blog-post-summary {
    border-bottom: 1px solid rgba(var(--primary-color-rgb), 0.15);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}
.blog-list .blog-post-summary:last-child {
    border-bottom: none;
}
.post-title a { 
    text-decoration: none; 
    color: var(--primary-color);
    transition: color 0.2s;
}
.post-title a:hover { color: var(--on-surface-color); }
.post-meta { font-size: 0.9rem; color: var(--on-surface-color); opacity: 0.7; margin-bottom: 1rem; }
.post-excerpt { margin-bottom: 1.5rem; }

.blog-post-full .post-body h3 {
    margin-top: 2.5rem;
}

/* --- Footer --- */
.site-footer {
    width: 100%;
    background-color: var(--surface-color);
    margin-top: auto;
    padding: 2rem;
    box-sizing: border-box;
    border-top: 1px solid rgba(var(--primary-color-rgb), 0.1);
    font-size: 0.9rem;
}

.site-footer .container {
    padding: 0; margin: 0 auto; max-width: 960px; display: flex; justify-content: space-between; align-items: center;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1rem; }
.site-footer a { text-decoration: none; color: var(--on-surface-color); transition: color 0.2s; }
.site-footer a:hover { color: var(--primary-color); }

/* --- Disqus Comments --- */
#disqus_thread {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    .page-content h1 { font-size: 2rem; }
    .container { padding: 1.5rem; }
    .main-nav { height: auto; flex-direction: column; padding: 1rem 0; gap: 1.5rem; }
    .nav-left, .nav-right { flex-direction: column; gap: 1rem; text-align: center; }
    .nav-left ul { flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 480px) {
    .input-container { flex-direction: column; }
}

/* --- Contact Form Specifics --- */
.form-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0;
    border-radius: 16px; /* Match other containers */
    background-color: transparent; /* The card will have the color */
    box-shadow: none; /* The card will have the shadow */
}

.form-card {
    background-color: var(--surface-color);
    padding: 2rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 25px var(--shadow-color), 0 20px 70px var(--shadow-color);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.form-card h2 {
    margin-top: 0;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.9;
}

.form-container input[type="text"],
.form-container input[type="email"],
.form-container textarea {
    width: 100%;
    padding: 1rem; /* Increased padding */
    font-size: 1rem;
    box-sizing: border-box; /* Important for width: 100% */
}

.form-container textarea {
    resize: vertical;
}

.form-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Add a less intrusive placeholder color */
::placeholder {
  color: var(--on-surface-color);
  opacity: 0.4;
}


#form-status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    display: none; /* Hidden by default */
    font-weight: 600;
}

#form-status.success {
    display: block;
    background-color: rgba(4, 182, 115, 0.2);
    color: #04b673;
    border: 1px solid #04b673;
}

#form-status.error {
    display: block;
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}
