/* ===== RESET & CƠ BẢN ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --border-color: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-orange: #d29922;

    /* Biến màu thương hiệu - sẽ được JS cập nhật động */
    --brand-color: #00ff00;
    --brand-color-light: rgba(26, 124, 62, 0.12);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 24px;
}

/* ===== LAYOUT ===== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

/* ===== FORM ===== */
.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
}

.form-section h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

/* ===== COLOR PICKER ===== */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0px 0px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.color-picker-row:hover {
    border-color: var(--accent-blue);
}

.color-picker-row input[type="color"] {
    width: 60px;
    height: 38px;
    padding: 2px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.color-picker-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-row input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ===== NÚT ===== */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-success {
    background: var(--accent-green);
    color: #fff;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== VÉ ===== */
.ticket-section {
    display: flex;
    justify-content: center;
}

.ticket {
    width: 100%;
    max-width: 520px;
    background: linear-gradient(135deg, #1a1f2b 0%, #0f1419 100%);
    border: 1px solid var(--brand-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--brand-color-light);
    position: relative;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Răng cưa 2 bên */
.ticket::before,
.ticket::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--bg-primary);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.ticket::before {
    left: -10px;
}

.ticket::after {
    right: -10px;
}

/* Header vé */
.ticket-header {
    background: var(--brand-color-light);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    transition: background 0.3s;
    position: relative;
}

/* Vạch màu đậm phía trên header */
.ticket-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-color);
    transition: background 0.3s;
}

.airline-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-color);
    transition: color 0.3s;
}

.plane-icon {
    font-size: 1.3rem;
}

.ticket-type {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Body vé */
.ticket-body {
    padding: 24px;
}

/* Lộ trình bay */
.route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.airport {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.airport-code {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.airport-city {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.airport-time {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-color);
    transition: color 0.3s;
}

.flight-path {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 4px;
}

.path-line {
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        var(--brand-color) 0,
        var(--brand-color) 4px,
        transparent 4px,
        transparent 8px
    );
    opacity: 0.6;
    transition: background 0.3s;
}

.plane-marker {
    font-size: 0.9rem;
    color: var(--brand-color);
    transition: color 0.3s;
}

/* Chi tiết vé */
.ticket-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Footer vé */
.ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
    margin-bottom: 16px;
}

.barcode {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 40px;
}

.barcode span {
    display: block;
    width: 3px;
    height: 100%;
    background: var(--text-primary);
    border-radius: 1px;
}

.barcode span:nth-child(2n) { width: 2px; height: 70%; }
.barcode span:nth-child(3n) { width: 4px; height: 90%; }
.barcode span:nth-child(5n) { width: 2px; height: 60%; }
.barcode span:nth-child(7n) { width: 3px; height: 80%; }

.pnr {
    text-align: right;
}

.pnr-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.pnr-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brand-color);
    letter-spacing: 2px;
    transition: color 0.3s;
}

/* Disclaimer */
.ticket-disclaimer {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 24px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border-color);
}

/* ===== THÔNG BÁO LỖI ===== */
.error-message {
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 500;
    line-height: 1.4;
}

/* Ô input khi có lỗi */
.form-group input.input-error {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.form-group input.input-error:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.25);
}