/* --- Cấu trúc Container --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Nền tảng trang dịch vụ */
.services-page-content {
    padding: 160px 0 100px;
    background: linear-gradient(rgba(18, 18, 18, 0.8), rgba(18, 18, 18, 0.9)), 
                url('https://i.pinimg.com/736x/68/f5/64/68f564286b9ba7d00c60265b9447f5f9.jpg');
    background-size: cover;
    background-attachment: fixed;
    color: #fff;
    min-height: 100vh;
}

/* --- Header: Căn giữa theo yêu cầu --- */
.services-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.services-header h1 { 
    font-size: clamp(32px, 5vw, 48px); 
    text-transform: uppercase; 
    font-weight: 900; 
    line-height: 1.2;
}
.services-header h1 span { color: #FF6600; }
.services-header p { font-size: 18px; opacity: 0.8; margin-top: 20px; line-height: 1.6; }

/* --- Grid Hệ thống: 4 cột giúp ô nhỏ lại --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
    perspective: 1500px;
}

/* --- Flip Card Core --- */
.service-card-flip {
    text-decoration: none;
    display: block;
    height: 320px; /* Chiều cao thấp hơn để ô trông nhỏ gọn */
    color: inherit;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.2, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.service-card-flip:hover .service-card-inner {
    transform: rotateY(180deg);
}

.service-card-front, .service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 30px; /* Cạnh tròn mạnh theo yêu cầu */
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-sizing: border-box;
    overflow: hidden;
}

/* --- Mặt trước: Thumbnail & Title góc dưới trái --- */
.service-card-front {
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55); /* Lớp phủ làm tối ảnh nền để nổi bật chữ */
    z-index: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    padding: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Đẩy tiêu đề xuống góc dưới */
    align-items: flex-start; /* Căn lề trái */
}

.service-card-front h3 {
    font-size: 18px; /* Chữ nhỏ lại phù hợp với kích thước ô */
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.flip-hint {
    font-size: 11px;
    color: #FF6600;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

/* --- Mặt sau: Nội dung tóm tắt căn trái --- */
.service-card-back {
    transform: rotateY(180deg);
    background: rgba(25, 25, 25, 0.98);
    backdrop-filter: blur(15px);
    border-color: rgba(255, 102, 0, 0.4);
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.service-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #eee;
    text-align: left;
}

.read-more {
    margin-top: auto;
    color: #FF6600;
    font-weight: 700;
    font-size: 13px;
}

/* --- Responsive cho các thiết bị di động --- */
@media (max-width: 1200px) {
    .services-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .services-grid { grid-template-columns: 1fr; }
    .service-card-flip { height: 300px; }
}

/* --- Preloader riêng cho trang Services --- */
#services-preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #0f0f0f;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

.services-loader {
    position: relative;
    width: 80px; height: 80px;
}

.services-loader .circle {
    width: 100%; height: 100%;
    border: 3px solid rgba(255, 102, 0, 0.1);
    border-top-color: #FF6600;
    border-radius: 50%;
    animation: services-spin 1s linear infinite;
}

.services-loader .text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
}

@keyframes services-spin {
    to { transform: rotate(360deg); }
}

/* --- Tối ưu thanh cuộn (Scrollbar) --- */
.services-page-content::-webkit-scrollbar {
    width: 6px;
}
.services-page-content::-webkit-scrollbar-thumb {
    background: #FF6600;
    border-radius: 10px;
}

/* --- Smooth Scroll --- */
html {
    scroll-behavior: smooth;
}

/* Đảm bảo Card lật mượt hơn với AOS */
.service-card-flip {
    will-change: transform, opacity;
}

/* --- Tinh chỉnh viền cho mặt trước --- */
.service-card-front {
    /* Viền trắng mờ tạo hiệu ứng kính */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: border-color 0.4s ease;
}

/* --- Tinh chỉnh viền cho mặt sau --- */
.service-card-back {
    /* Viền màu cam đặc trưng của VEA nhưng mờ ảo */
    border: 1.5px solid rgba(255, 102, 0, 0.4) !important;
    background: rgba(20, 20, 20, 0.95) !important;
    box-shadow: inset 0 0 15px rgba(255, 102, 0, 0.1);
}

/* --- Hiệu ứng khi di chuột (Hover) --- */
.service-card-flip:hover .service-card-front {
    border-color: rgba(255, 102, 0, 0.5) !important;
}

.service-card-flip:hover .service-card-back {
    /* Khi lật mặt sau, viền cam sẽ sáng rực hơn một chút */
    border-color: rgba(255, 102, 0, 0.8) !important;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.2);
}

/* Đảm bảo bo góc tròn mạnh theo thiết kế cũ */
.service-card-front, .service-card-back {
    border-radius: 30px !important;
}