/* Base Variables & Typography */
:root {
    --primary: #8a2be2;
    --primary-hover: #7b2cbf;
    --secondary: #00f5d4;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Blobs for dynamic aesthetic */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
    animation: fadeInDown 0.8s ease;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Form Elements */
textarea {
    width: 100%;
    min-height: 200px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(0, 245, 212, 0.2);
}

button {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.4);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Process Flow Steps */
.process-section {
    margin-top: 1rem;
}

.steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.5s ease;
}

.step-content {
    flex-grow: 1;
}

.step h4 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    transition: color 0.3s ease;
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Active Step */
.step.active .step-indicator {
    border-color: var(--secondary);
    color: var(--secondary);
    box-shadow: 0 0 15px rgba(0, 245, 212, 0.4);
}
.step.active h4 { color: var(--text-main); }
.step.active .status-text { color: var(--secondary); }

/* Completed Step */
.step.completed .step-indicator {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.step.completed h4 { color: var(--text-main); }
.step.completed .status-text { color: var(--text-muted); }

/* Search Results UI */
#search-results-container {
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease;
}

.search-count {
    color: var(--secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.url-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 600px) {
    .url-list {
        grid-template-columns: 1fr;
    }
}

.search-card {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: background 0.2s, transform 0.2s;
    cursor: pointer;
    overflow: hidden;
    min-width: 0;
}

.search-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.search-card-title {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.search-card-domain {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Results Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: fixed;
    word-wrap: break-word;
}

th:nth-child(1) { width: 12%; } /* Category */
th:nth-child(2) { width: 8%; } /* Risk Level */
th:nth-child(3) { width: 33%; } /* Reason */
th:nth-child(4) { width: 14%; } /* Source Links */
th:nth-child(5) { width: 33%; } /* Alternative Wording */

th, td {
    padding: 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--glass-border);
}

th {
    font-weight: 600;
    color: var(--secondary);
    background: rgba(0, 0, 0, 0.2);
}

tbody tr {
    transition: background 0.3s;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}
.risk-high { background-color: var(--danger); }
.risk-medium { background-color: var(--warning); }
.risk-low { background-color: var(--success); }

td.center-align, th.center-align {
    text-align: center;
}

.quote-block {
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--primary);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.9em;
    color: var(--text-main);
}
.quote-translation {
    font-size: 0.85em;
    color: var(--text-muted);
}

.source-links a {
    display: block;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}
.source-links a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
