/* Modern Dark Theme Variables */
:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #06b6d4;
    --primary-hover: #0891b2;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 40%);
}

.container {
    width: 100%;
    max-width: 1400px;
    /* Increased for side-by-side */
    padding: 20px;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    /* Form takes 1 part, Table takes 2 parts */
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .layout-grid {
        grid-template-columns: 1fr;
        /* Stack on smaller screens */
    }
}

/* Glassmorphism Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #22d3ee, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* Readonly Output */
.normalized-output {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 1px;
    cursor: pointer;
}

/* Button */
.btn-save {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.btn-save:active {
    transform: translateY(0);
}

/* Stats */
.stats-bar {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.highlight-count {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* CRM Float */
.crm-link {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.crm-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.crm-icon {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

/* Table Styles - Shared */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
    font-size: 0.9rem;
}

th,
td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: rgba(30, 41, 59, 0.8);
    font-weight: 600;
    color: var(--primary);
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.status-active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-decoration: none;
}

.back-link:hover {
    color: var(--primary);
}

/* Copy on Click */
.copy-clickable {
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.copy-clickable:hover {
    color: var(--primary);
    background-color: rgba(6, 182, 212, 0.1);
}

.copy-clickable:active {
    transform: scale(0.95);
}

/* Optional tooltip for feedback */
.copy-clickable::after {
    content: "Copied!";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.copy-clickable.copied::after {
    opacity: 1;
}