/* Định nghĩa biến màu sắc */
:root {
    /* Chế độ ban đêm (mặc định) */
    --background-gradient: linear-gradient(135deg, #1e293b 0%, #2d3748 100%);
    --container-bg: rgba(41, 53, 72, 0.95);
    --container-border: rgba(255, 255, 255, 0.15);
    --section-bg: rgba(45, 55, 72, 0.9);
    --section-border: rgba(255, 255, 255, 0.15);
    --text-color: #f1f5f9;
    --label-color: #a1b1c2;
    --input-bg: linear-gradient(145deg, #2d3748, #3f4c6b);
    --input-border: rgba(255, 255, 255, 0.3);
    --input-readonly-bg: linear-gradient(145deg, #1e293b, #2d3748);
    --primary-btn-bg: linear-gradient(145deg, #1e3a8a, #3b82f6);
    --primary-btn-hover-bg: linear-gradient(145deg, #3b82f6, #60a5fa);
    --secondary-btn-bg: linear-gradient(145deg, #4b5563, #6b7280);
    --secondary-btn-hover-bg: linear-gradient(145deg, #6b7280, #9ca3af);
    --danger-btn-bg: linear-gradient(145deg, #7f1d1d, #b91c1c);
    --danger-btn-hover-bg: linear-gradient(145deg, #b91c1c, #dc2626);
    --info-btn-bg: linear-gradient(145deg, #14532d, #15803d);
    --info-btn-hover-bg: linear-gradient(145deg, #15803d, #22c55e);
    --error-bg: linear-gradient(145deg, #7f1d1d, #b91c1c);
    --error-border: #dc2626;
    --error-text: #fed7d7;
    --tab-bg: linear-gradient(145deg, #1e3a8a, #3b82f6);
    --tab-hover-bg: linear-gradient(145deg, #3b82f6, #60a5fa);
    --tab-active-bg: linear-gradient(145deg, #3b82f6, #60a5fa);
    --border-color: #4b5563;
    --shadow-color: rgba(0, 0, 0, 0.8);
    --header-bg: linear-gradient(145deg, #2d3748, #1e293b);
}

/* Chế độ ban ngày */
body.day-mode {
    --background-gradient: linear-gradient(135deg, #f1f5f9 0%, #e5e7eb 100%);
    --container-bg: rgba(255, 255, 255, 0.95);
    --container-border: rgba(0, 0, 0, 0.1);
    --section-bg: rgba(243, 244, 246, 0.9);
    --section-border: rgba(0, 0, 0, 0.1);
    --text-color: #1e293b;
    --label-color: #4b5563;
    --input-bg: linear-gradient(145deg, #ffffff, #f3f4f6);
    --input-border: rgba(0, 0, 0, 0.2);
    --input-readonly-bg: linear-gradient(145deg, #e5e7eb, #f3f4f6);
    --primary-btn-bg: linear-gradient(145deg, #2563eb, #3b82f6);
    --primary-btn-hover-bg: linear-gradient(145deg, #1e40af, #2563eb);
    --secondary-btn-bg: linear-gradient(145deg, #6b7280, #9ca3af);
    --secondary-btn-hover-bg: linear-gradient(145deg, #4b5563, #6b7280);
    --danger-btn-bg: linear-gradient(145deg, #b91c1c, #dc2626);
    --danger-btn-hover-bg: linear-gradient(145deg, #7f1d1d, #b91c1c);
    --info-btn-bg: linear-gradient(145deg, #15803d, #22c55e);
    --info-btn-hover-bg: linear-gradient(145deg, #14532d, #15803d);
    --error-bg: linear-gradient(145deg, #fee2e2, #fecaca);
    --error-border: #ef4444;
    --error-text: #b91c1c;
    --tab-bg: linear-gradient(145deg, #2563eb, #3b82f6);
    --tab-hover-bg: linear-gradient(145deg, #1e40af, #2563eb);
    --tab-active-bg: linear-gradient(145deg, #1e40af, #2563eb);
    --border-color: #d1d5db;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --header-bg: linear-gradient(145deg, #ffffff, #f3f4f6);
}

/* Reset cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: var(--background-gradient);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
.header {
    position: relative;
    text-align: center;
    padding: 20px 10px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 10px var(--shadow-color);
}

.header h1 {
    font-size: 30px;
    font-weight: 700;
    background: linear-gradient(to right, #d4af37, #fef08a);
    background-clip: text;
    color:#ca9d08;
    margin-bottom: 6px;
}

.header p {
    font-size: 14px;
    color: var(--label-color);
}

/* Mode Toggle Button */
.mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.mode-toggle:hover {
    transform: scale(1.2);
}

/* Container chính */
.container {
    max-width: 900px;
    margin: 15px auto;
    padding: 15px;
    background: var(--container-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid var(--container-border);
    box-shadow: 0 8px 30px var(--shadow-color);
}

/* Error Display */
.error-display {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.error-display.show {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.error-display:hover {
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.6);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* General Section Styling */
section {
    margin-bottom: 15px;
}

section h2 {
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(to right, #d4af37, #fef08a);
    background-clip: text;
    color:#ca9d08;
    margin-bottom: 8px;
    padding-bottom: 4px;
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(to right, #d4af37, #fef08a);
}

/* U Section */
.u-section {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
    padding: 12px;
    background: var(--section-bg);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    border: 1px solid var(--section-border);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.u-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Tùy chỉnh container của select */
.u-select {
    position: relative;
    width: 100%; /* Đảm bảo dropdown chiếm toàn bộ chiều rộng của container */
}

/* Tùy chỉnh select */
#u-select {
    width: 100%;
    padding: 8px 30px 8px 12px; /* Thêm padding bên phải để chừa chỗ cho mũi tên */
    font-size: 14px;
    border: 1px solid #4b5563; /* Viền xám đậm */
    border-radius: 6px;
    background-color: #3b82f6; /* Màu nền xanh dương sáng */
    color: #ffffff; /* Chữ trắng */
    appearance: none; /* Loại bỏ giao diện mặc định của trình duyệt */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Hiệu ứng hover */
#u-select:hover {
    background-color: #0e3487; /* Xanh đậm hơn khi hover */
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Hiệu ứng focus */
#u-select:focus {
    outline: none;
    border-color: #d4af37; /* Viền ánh kim khi focus */
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.7);
}

/* Tùy chỉnh mũi tên dropdown */
#u-select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Tùy chỉnh option (danh sách thả xuống) */
#u-select option {
    background-color: #f1f5f9; /* Nền trắng xám cho danh sách thả xuống */
    color: #1e293b; /* Chữ đen đậm */
    padding: 8px;
}

/* Đảm bảo option hover có màu nổi bật */
#u-select option:hover {
    background-color: #e5e7eb; /* Xám nhạt hơn khi hover */
}
.u-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Dependency Section */
.dependency-section {
    padding: 12px;
    background: var(--section-bg);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    border: 1px solid var(--section-border);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.dependency-container {
    display: flex;
    gap: 10px;
}

.left-section, .right-section {
    flex: 1;
}

.right-section textarea {
    height: 100px;
    min-width: 100%;
}

/* Tabbed Section */
.tabbed-section {
    margin-top: 10px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    padding: 8px 16px;
    background: var(--tab-bg);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: var(--tab-hover-bg);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.7);
}

.tab-button.active {
    background: var(--tab-active-bg);
    color: #fff;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.tab-content {
    display: none;
    padding: 12px;
    background: var(--section-bg);
    backdrop-filter: blur(8px);
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--section-border);
    border-top: none;
}

.tab-content.active {
    display: block;
}

/* X+ Section */
.x-plus-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Tab Items */
.tab-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.tab-item textarea {
    height: 70px;
}

/* General Input Styling */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-weight: 500;
    font-size: 14px;
    color: var(--label-color);
}

input, textarea, select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

input:focus, textarea:focus, select:focus {
    border: 1px solid transparent;
    border-image: linear-gradient(to right, #d4af37, #fef08a) 1;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.7);
}

input[readonly], textarea[readonly] {
    background: var(--input-readonly-bg);
    cursor: default;
}

textarea {
    resize: none;
}

/* Select Styling */
select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="currentColor" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Button Styling */
.btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-btn-bg);
    color: var(--text-color);
}

.btn-primary:hover {
    background: var(--primary-btn-hover-bg);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.8);
}

.btn-secondary {
    background: var(--secondary-btn-bg);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--secondary-btn-hover-bg);
    box-shadow: 0 0 20px rgba(156, 163, 175, 0.8);
}

.btn-danger {
    background: var(--danger-btn-bg);
    color: var(--text-color);
}

.btn-danger:hover {
    background: var(--danger-btn-hover-bg);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.8);
}

.btn-info {
    background: var(--info-btn-bg);
    color: var(--text-color);
}

.btn-info:hover {
    background: var(--info-btn-hover-bg);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
}

.btn-infos {
    background: var(--info-btn-bg);
    color: var(--text-color);
}

.btn-infos:hover {
    background: var(--info-btn-hover-bg);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
}
/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 8px;
    }

    .header h1 {
        font-size: 20px;
    }

    .header p {
        font-size: 12px;
    }

    section h2 {
        font-size: 16px;
    }

    .u-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .dependency-container {
        flex-direction: column;
        gap: 8px;
    }

    .dependency-actions {
        flex-direction: column;
        gap: 6px;
    }

    .btn {
        width: 100%;
    }

    .tab-buttons {
        flex-wrap: wrap;
        gap: 3px;
    }

    .tab-button {
        flex: 1;
        text-align: center;
        padding: 6px;
        font-size: 12px;
    }

    .mode-toggle {
        top: 10px;
        right: 10px;
        font-size: 20px;
    }
}