/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem 0;
    box-shadow: var(--shadow-lg);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.logo {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 7px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.95;
    text-align: center;
}

/* ===== Container ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== Main Content ===== */
main {
    flex: 1;
    padding: 1.5rem 0;
}

/* ===== Instructions ===== */
.instructions {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.35rem;
    box-shadow: var(--shadow);
}

.instructions p {
    margin: 0;
    color: var(--text-primary);
}

/* ===== Privacy Notice ===== */
.privacy-notice {
    background: #f8fafc;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.privacy-notice p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Workspace Layout ===== */
.workspace {
    display: grid;
    grid-template-columns: 1fr 300px 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .workspace {
        grid-template-columns: 1fr;
    }
}

/* ===== Panels ===== */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    background: #f8fafc;
}

/* ===== Input Panel ===== */
.input-panel textarea {
    flex: 1;
    width: 100%;
    padding: 1rem;
    border: none;
    resize: none;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    outline: none;
}

.input-panel textarea::placeholder {
    color: var(--text-secondary);
}

/* ===== Column Selector Panel ===== */
.selector-panel {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

.column-actions {
    display: flex;
    gap: 1rem;
}

.column-list {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.column-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.column-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.column-item.selected {
    background: #eff6ff;
    border-color: var(--primary-color);
}

.column-item input[type="checkbox"] {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.column-info {
    flex: 1;
}

.column-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.column-format {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.format-email {
    background: #dbeafe;
    color: #1e40af;
}

.format-phone {
    background: #dcfce7;
    color: #166534;
}

.format-date {
    background: #fef3c7;
    color: #92400e;
}

.format-number {
    background: #e0e7ff;
    color: #3730a3;
}

.format-text {
    background: #f3f4f6;
    color: #374151;
}

.format-url {
    background: #fce7f3;
    color: #831843;
}

/* ===== Output Panel ===== */
.output-display {
    flex: 1;
    padding: 1rem;
    overflow: auto;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9rem;
}

.output-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.output-table th,
.output-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid var(--border);
}

.output-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
}

.output-table tr:hover {
    background: #f8fafc;
}

.output-table .randomized-cell {
    background: #fef3c7;
}

/* ===== Placeholder Text ===== */
.placeholder-text {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: var(--secondary-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--primary-hover);
}

/* ===== Stats Section ===== */
.stats-section {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ===== Footer ===== */
footer {
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.footer-section ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.column-item {
    animation: fadeIn 0.3s ease-out;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    .logo-container {
        gap: 0.75rem;
    }

    .container {
        padding: 0 1rem;
    }

    .workspace {
        gap: 1rem;
    }

    .panel {
        min-height: 400px;
    }

    .stats-section {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
