:root {
    --bg-color: #e6ebf1;
    --card-bg: #e6ebf1;
    --text-primary: #333;
    --text-secondary: #666;
    --danger-color: #ff0000;
    --ais-color: #28a745;
    --dtac-color: #007bff;
    --true-color: #dc3545;
    --shadow-light: #ffffff;
    --shadow-dark: #c8d0d9;
    --gradient-start: #ff0000;
    --primary-color: #00d2ff;
    --gradient-end: #00d2ff; /* เปลี่ยนเป็นสีฟ้าสว่างเพื่อให้ตัวหนังสือ gradient อ่านง่ายขึ้น */
}

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

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding-bottom: 100px;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(to bottom, #e6ebf1 0%, #d1d9e6 100%);
}

.bg-logo-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1000px;
    opacity: 0.05;
    pointer-events: none;
    user-select: none;
    z-index: -1;
    filter: grayscale(100%);
}

/* Meteor Shower */
.star {
    position: absolute;
    background: linear-gradient(45deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,0) 100%);
    width: 100px;
    height: 2px;
    transform: rotate(-45deg);
    filter: drop-shadow(0 0 6px #fff);
    animation: meteor 3s linear infinite;
    opacity: 0;
}

@keyframes meteor {
    0% { transform: rotate(-45deg) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: rotate(-45deg) translateX(-1000px); opacity: 0; }
}

/* Floating Social Icons */
.floating-social {
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.2); /* เปลี่ยนเป็นสีขาวจางๆ เพื่อให้เห็นชัดบนพื้นหลังมืด */
    pointer-events: none;
    animation: float 15s linear infinite;
    z-index: -1;
}

@keyframes float {
    0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

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

/* Music Control */
.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.music-control i {
    font-size: 18px;
    color: #ffffff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.music-control.playing {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
    animation: pulse 2s infinite;
}

.music-control.playing i {
    color: var(--primary-color);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

#youtube-player-container {
    position: absolute;
    top: -1000px;
    left: -1000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 40px;
}

.gradient-text {
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    color: #444;
    font-weight: 400;
}

/* Accordion */
.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.accordion-item {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--ais-color);
    font-size: 1.2rem;
}

.accordion-header i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.accordion-content {
    padding: 0 30px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 2000px; /* Large enough to fit content */
    padding-bottom: 30px;
}

.accordion-item.active .accordion-header i {
    transform: rotate(180deg);
}

/* Promo Grid */
.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.promo-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 20px;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    font-size: 0.95rem;
    line-height: 1.8;
}

.promo-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #555;
}

.promo-card p.code {
    font-weight: 500;
}

.promo-card a.dial-link {
    color: #0000ff;
    text-decoration: none;
    border: 1px solid #0000ff;
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 600;
    display: inline-block;
    margin: 0 5px;
    background: rgba(0, 0, 255, 0.05);
    transition: all 0.2s ease;
}

.promo-card a.dial-link:hover {
    background: #0000ff;
    color: #fff;
}

.danger-text { color: var(--danger-color); font-weight: 500; }
.ais-text { color: var(--ais-color); font-weight: 500; }
.dtac-text { color: #008000; font-weight: 500; }

/* V2ray List */
.v2ray-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.v2ray-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.v2ray-info strong {
    display: block;
    color: var(--true-color);
    font-size: 1rem;
}

.v2ray-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-small {
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    text-decoration: none;
    background: var(--card-bg);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    color: var(--text-primary);
    transition: all 0.2s;
}

.btn-small:active {
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}

.v2ray-item a.dial-link {
    color: #0000ff;
    text-decoration: none;
    border: 1px solid #0000ff;
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 600;
    background: rgba(0, 0, 255, 0.05);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.v2ray-item a.dial-link:hover {
    background: #0000ff;
    color: #fff;
}

/* App Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    justify-items: center;
}

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

.app-item img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    margin-bottom: 10px;
    object-fit: cover;
}

.app-item p {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Video List */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 20px;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.video-card iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 15px;
    margin-bottom: 10px;
}

.video-card p {
    text-align: center;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
    .gradient-text {
        font-size: 1.8rem;
    }
    
    .accordion-header {
        padding: 15px 20px;
        font-size: 1.1rem;
    }
    
    .promo-grid {
        grid-template-columns: 1fr;
    }
}

/* --- แผงควบคุมผู้ดูแลระบบและหน้าต่างเข้ารหัส (Premium Admin & Secure Modals) --- */
.admin-modal, .secure-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.admin-modal.show, .secure-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(22, 27, 41, 0.85);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    color: #fff;
}

.admin-modal .modal-content {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ff3d6e;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.btn-primary, .btn-success, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #00d2ff, #004e92);
    color: #fff;
}

.btn-primary:hover {
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #21d07a, #008000);
    color: #fff;
    margin-top: 10px;
}

.btn-success:hover {
    box-shadow: 0 0 15px rgba(33, 208, 122, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Toast Premium */
.admin-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.95), rgba(0, 78, 146, 0.95));
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.admin-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.admin-section h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}


