:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: #f1f5f9;
    background-image: 
        radial-gradient(at 0% 0%, hsla(221, 83%, 53%, 0.1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(199, 89%, 48%, 0.1) 0, transparent 50%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    fill: var(--primary);
}

/* Glass Card */
.glass {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hero Section */
.hero h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.subtitle {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #334155;
}

.example-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-family: monospace;
    word-break: break-all;
}

.highlight {
    background: #dbeafe;
    padding: 0 4px;
    border-radius: 2px;
}

/* Input Styles */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group label {
    font-weight: 600;
    color: var(--text-muted);
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
}

input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Result Section */
.result-section {
    text-align: center;
    border-top: 4px solid var(--warning);
}

.result-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.code-display {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.1em;
}

.copy-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: -0.5rem;
}

.timer-container {
    max-width: 400px;
    margin: 2rem auto 0;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 1s linear;
}

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

#seconds-left {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #ecfdf5;
    color: var(--success);
    border-radius: 4px;
    font-weight: 700;
    margin-right: 0.25rem;
}

/* Table */
.table-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
}

.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.table-input {
    width: 100%;
    padding: 0.4rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.table-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

tbody tr:hover {
    background: #f8fafc;
}

/* Helpers */
.hidden {
    display: none;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
}

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

.glass {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .input-wrapper {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .code-display {
        font-size: 2.5rem;
    }
}
