/* 
 * Responsive Styles for ThaoNhiEvent Theme
 * Mobile-first approach with breakpoints
 */

/* Extra small devices (phones, 576px and down) */
@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .header-main {
        flex-direction: column;
        text-align: center;
    }
    
    .site-branding {
        margin-bottom: 15px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .header-contact {
        flex-direction: column;
    }
    
    .header-contact span {
        margin: 5px 0;
    }
    
    .site-main {
        padding: 20px 0;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-bottom {
        text-align: center;
    }
    
    .footer-bottom p {
        margin-bottom: 10px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .header-main {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .site-branding {
        margin-bottom: 0;
    }
    
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .footer-widgets {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
}

/* Navigation responsiveness */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .primary-menu-container {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 1px;
                                               NEN MENU CHA
    }
    
    .primary-menu-container.toggled {
        display: block;
    }
    
    .menu {
        flex-direction: column;
    }
    
    .menu li {
        margin: 0;
        width: 100%;
    }

    .menu-toggle-text {
        xoa chu nay la an display: none; /*                             Ẩn chữ "Menu" trên mobile */
    }
    
    .menu a {
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin-left: 15px;
        display: none;
    }
    
    .menu li.menu-item-has-children > a::after {
        content: "▼";
        margin-left: 5px;
        font-size: 10px;
    }
    
    .menu li.menu-item-has-children.active > .sub-menu {
        display: block;
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
    
    .primary-menu-container {
        display: block !important;
    }
}

/* Form responsiveness */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        width: 100%;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Image responsiveness */
img {
    max-width: 100%;
    height: auto;
}

/* Video responsiveness */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Utility classes for responsive design */
.hidden-mobile {
    display: none;
}

.visible-mobile {
    display: block;
}

@media (min-width: 769px) {
    .hidden-mobile {
        display: block;
    }
    
    .visible-mobile {
        display: none;
    }
}

/* Responsive text sizing */
@media (max-width: 768px) {
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 24px;
    }
    
    h3 {
        font-size: 20px;
    }
    
    p, li {
        font-size: 16px;
    }
}

/* Responsive table */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

/* Responsive gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

@media (max-width: 576px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: popupFadeIn 0.5s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    color: #000;
}

.popup-header {
    text-align: center;
    margin-bottom: 25px;
}

.popup-header h3 {
    color: #0066cc;
    margin-bottom: 10px;
    font-size: 24px;
}

.popup-header p {
    color: #666;
    margin: 0;
}

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

.popup-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.popup-form input,
.popup-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.popup-form input:focus,
.popup-form textarea:focus {
    outline: none;
    border-color: #0066cc;
}

.popup-form button {
    width: 100%;
    padding: 15px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.popup-form button:hover {
    background-color: #004499;
}

.popup-message {
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    text-align: center;
}

.popup-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.popup-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive popup */
@media (max-width: 576px) {
    .popup-content {
        padding: 20px;
        margin: 10px;
    }
    
    .popup-header h3 {
        font-size: 20px;
    }
    
    .popup-form input,
    .popup-form textarea {
        padding: 10px;
        font-size: 14px;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.back-to-top:hover {
    background-color: #004499;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top svg {
    transition: transform 0.3s ease;
}

.back-to-top:hover svg {
    transform: translateY(-2px);
}

/* Responsive design for back to top button */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 576px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .back-to-top svg {
        width: 18px;
        height: 18px;
    }
}