@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0b0d14;
    --panel-bg: rgba(20, 23, 33, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --input-bg: rgba(15, 17, 26, 0.8);
    --hover-bg: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

/* Typography styles */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 600; }
a { text-decoration: none; color: inherit; }

/* Layout utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 2rem;
    transition: color 0.3s ease;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0 5rem 0;
}
.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Grid Layouts for Landing page */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Tool Card */
.tool-card {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    border-radius: 16px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.tool-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 15px 30px -10px rgba(59, 130, 246, 0.2);
}
.tool-card.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
.tool-card.disabled:hover { transform: none; box-shadow: none; border-color: var(--border-color); }

.tool-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

.tool-card h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.tool-card p { color: var(--text-muted); font-size: 0.95rem; flex-grow: 1; }
.tool-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}
.disabled .tool-badge { background: rgba(255,255,255,0.1); color: var(--text-muted); }

/* --- HTXRD Tool Specific Styles --- */
.tool-header {
    margin-bottom: 2rem;
}
.tool-header h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.tool-header p { color: var(--text-muted); }

/* Split forms layout */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
@media (max-width: 900px) {
    .tool-layout { grid-template-columns: 1fr; }
}

/* File Upload Dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--input-bg);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.05);
}
.dropzone input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.drop-icon {
    font-size: 3rem; color: var(--accent-primary); margin-bottom: 1rem;
}
.file-list {
    margin-top: 1rem;
    text-align: left;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
}
.file-item {
    background: var(--hover-bg);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
input[type="text"], input[type="number"], select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: var(--accent-primary);
}

/* Checkbox Toggle Switch UI */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--hover-bg);
    border-radius: 8px;
    margin-bottom: 1rem;
}
.toggle-row label {
    margin: 0; color: var(--text-main); font-size: 1rem;
}
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute; content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}
input:checked + .slider:before {
    transform: translateX(24px);
    background-color: #fff;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 1rem;
}
.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* Progress Overlay */
.progress-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(11, 13, 20, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.progress-overlay.active {
    opacity: 1; pointer-events: all;
}
.progress-box {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    width: 90%;
    max-width: 500px;
    text-align: center;
}
.progress-title {
    font-size: 1.5rem; margin-bottom: 1rem;
}
.progress-status {
    color: var(--accent-primary); font-weight: 500; margin-bottom: 2rem;
}

.spinner {
    width: 50px; height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Dependent inputs hidden initially */
.conditional-fields {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}
.conditional-fields.open {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 1rem;
}
