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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f7fafc;
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Three Column Layout */
.three-column-grid {
    display: grid;
    grid-template-columns: 300px 2fr 0.8fr;
    gap: 1.5rem;
    align-items: start;
    height: calc(100vh - 3rem);
}

.controls-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
}

.middle-column {
    display: flex;
    flex-direction: column;
}

.right-column {
    display: flex;
    flex-direction: column;
}

.card-full-height {
    height: calc(100vh - 6rem);
    display: flex;
    flex-direction: column;
}

.card-full-height .names-display,
.card-full-height .queue-display {
    flex: 1;
    max-height: none;
    overflow-y: auto;
}

/* Card Components */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-large {
    flex: 1;
    min-height: 400px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #4299e1, #3182ce);
    border-radius: 2px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 400;
}

/* Main Content */
.main {
    padding: 1.5rem;
}

.section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
}

/* Link Section */
.link-section {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

#linkTextarea {
    flex: 1;
    height: 60px;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #f8fafc;
}

.section-compact {
    padding: 0.75rem 1.5rem;
}

.section-compact .section-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.input-compact {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.btn-compact {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}



.serial-names-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.serial-name-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

.serial-name-item.unclaimed {
    background: #c6f6d5;
    border-color: #48bb78;
}

.serial-name-item.claimed {
    background: #fed7d7;
    border-color: #e53e3e;
}

.serial-name-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.serial-name-text {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.7rem;
}

.serial-name-number {
    background: #4299e1;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
}

.serial-radio-group {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.serial-radio-option {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.serial-radio-option input[type="radio"] {
    width: 12px;
    height: 12px;
    cursor: pointer;
    accent-color: #4299e1;
}

.serial-radio-option label {
    cursor: pointer;
    font-size: 0.6rem;
    color: #4a5568;
    font-weight: 500;
}

#linkTextarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Input Groups */
.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
    align-items: stretch;
}

.link-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.number-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input {
    padding: 0.6rem 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    background: #f8fafc;
    flex: 1;
    min-width: 0;
}

.input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    background: white;
}

.input-number {
    width: 60px;
    text-align: center;
    padding: 0.4rem;
    flex: none;
    font-size: 0.8rem;
}

.textarea {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    height: 80px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    background: white;
}

/* Buttons */
.btn {
    padding: 0.6rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 0;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.delete-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
}

.btn-half {
    flex: 1;
    font-size: 0.7rem;
    padding: 0.5rem 0.5rem;
    min-width: 0;
}

.btn-control {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #718096, #4a5568);
    color: white;
    box-shadow: 0 4px 12px rgba(113, 128, 150, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(113, 128, 150, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c53030, #9c2626);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.btn-small {
    padding: 0.5rem 0.75rem;
    min-width: 40px;
    font-size: 0.875rem;
}

/* Controls */
.queue-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

/* Display Areas */
.queue-display {
    min-height: 200px;
    max-height: 200px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
    overflow-y: auto;
}

.simple-queue-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
}

.simple-queue-item {
    padding: 0.25rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
}

.queue-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.simple-queue-date {
    font-size: 0.6rem;
    color: #e53e3e;
    font-weight: 400;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header .card-title {
    margin-bottom: 0;
}

.btn-small {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
}

.simple-queue-name {
    font-weight: 400;
    color: #4a5568;
    font-size: 0.75rem;
}

.simple-queue-position {
    color: #4299e1;
    font-size: 0.65rem;
    font-weight: 600;
}

.names-display {
    max-height: 700px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    background: #f8fafc;
}

.empty-state {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    margin: 2rem 0;
    font-size: 0.9rem;
}

.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.queue-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.queue-item:hover {
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.queue-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.queue-item-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.queue-item-position {
    background: #4299e1;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4299e1;
}

.radio-option label {
    cursor: pointer;
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: #e53e3e;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .three-column-grid {
        grid-template-columns: 280px 2fr 0.8fr;
        gap: 1rem;
    }
}

@media (max-width: 1024px) {
    .three-column-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .controls-column {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .three-column-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .controls-column {
        grid-column: auto;
        display: flex;
        flex-direction: column;
    }
    
    .card-full-height {
        height: 400px;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .queue-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .toast {
        right: 15px;
        left: 15px;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .section {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .queue-controls {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}