/* daiminhnhat-frontend.css */
.lvn-filter-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.lvn-daiminhnhat-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* Day section */
.lvn-daiminhnhat-day-container {
    margin-bottom: 30px;
    overflow: hidden;
}

.lvn-daiminhnhat-header {
    padding: 10px;
}

.lvn-daiminhnhat-header-top {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
    margin-bottom: 25px;
}

.lvn-daiminhnhat-wrapper .lvn-daiminhnhat-title {
    font-size: 24px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    font-family: inherit;
}

.lvn-badge {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
}

.lvn-badge.daiminhnhat {
    padding: 8px 12px;
    border: 2px solid #ffffffa0;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    box-shadow:
        0 0 5px rgba(255, 255, 255, 0.6),
        0 0 15px rgba(79, 172, 254, 0.7),
        0 0 30px rgba(0, 242, 254, 0.4),
        0 0 50px rgba(0, 242, 254, 0.2);
    animation: lvn-badge-pulse 2.5s ease-in-out infinite;
    outline: none;
    border-radius: 30px;
}

@keyframes lvn-badge-pulse {

    0%,
    100% {
        box-shadow:
            0 0 5px rgba(255, 255, 255, 0.6),
            0 0 15px rgba(79, 172, 254, 0.7),
            0 0 30px rgba(0, 242, 254, 0.4),
            0 0 50px rgba(0, 242, 254, 0.2);
    }

    50% {
        box-shadow:
            0 0 10px rgba(255, 255, 255, 0.8),
            0 0 25px rgba(79, 172, 254, 0.9),
            0 0 45px rgba(0, 242, 254, 0.6),
            0 0 70px rgba(0, 242, 254, 0.3);
        transform: scale(1.02);
    }
}



.lvn-badge.not-daiminhnhat {
    background: linear-gradient(135deg, #ff7b7b, #ff9a56);
}

.lvn-daiminhnhat-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lvn-daiminhnhat-wrapper .lvn-daiminhnhat-nav button {
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid rgba(128, 128, 128, 0.2);
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

[data-theme="light"] .lvn-daiminhnhat-wrapper .lvn-daiminhnhat-nav button {
    background: rgba(0, 0, 0, 0.05);
}

.lvn-daiminhnhat-nav button:hover {
    background: rgba(128, 128, 128, 0.2);
    border-color: var(--gold);
}

.lvn-daiminhnhat-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lvn-daiminhnhat-basic-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.lvn-info-row {
    display: flex;
    align-items: baseline;
    padding: 4px 0;
}

.lvn-label {
    flex: 0 0 140px;
    color: var(--gold, #c5a059);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    font-family: "Playfair Display", serif;
}

.lvn-value {
    flex: 1;
    font-weight: 500;

}

.lvn-sub-value {
    font-size: 0.95rem;
    opacity: 0.7;
    margin-left: 8px;
    font-family: inherit;
    font-weight: normal;
}

.lvn-nguhanh-badge {
    padding: 3px 12px !important;
    border-radius: 4px;
    color: #fff !important;
    font-size: 0.9rem !important;
    font-family: inherit !important;
    display: inline-block !important;
    font-weight: 600 !important;
}

/* Main content */
.lvn-daiminhnhat-main-content {
    padding: 10px;
}

.lvn-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.lvn-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.lvn-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    /*color: #374151;*/
    margin: 0 0 15px 0;
}

.lvn-icon {
    font-size: 20px;
}

.lvn-section-content {
    /*background: #f9fafb;*/
    padding: 5px 15px;
    /* border-left: 4px solid #667eea; */
}

.lvn-section-content ul {
    margin: 0;
    padding-left: 0px;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.lvn-section-content ul li {
    width: 33%;
}

.lvn-section-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Time grid for hours */
.lvn-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.lvn-hour-item {
    padding: 10px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lvn-hour-item.good {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
}

.lvn-hour-item.bad {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
}

.lvn-hour-time {
    font-weight: 500;
}

.lvn-hour-name {
    font-weight: bold;

}

/* Grid layout */
.lvn-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* Loading states */
#lvn-daiminhnhat-day-section {
    margin-top: 30px;
}

#lvn-daiminhnhat-day-section.loading,
#lvn-daiminhnhat-month-section.loading {
    position: relative;
    min-height: 200px;

}

#lvn-daiminhnhat-day-section.loading::after,
#lvn-daiminhnhat-month-section.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .lvn-daiminhnhat-header-top {
        flex-direction: column;
        gap: 20px;
        align-items: center;
        text-align: center;
    }

    .lvn-daiminhnhat-title {
        justify-content: center;
    }

    .lvn-badge.daiminhnhat {
        width: 100%;
        display: block;
        margin: 5px 0;
        box-sizing: border-box;
    }

    .lvn-daiminhnhat-nav {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .lvn-time-grid {
        grid-template-columns: 1fr;
    }

    .lvn-daiminhnhat-basic-info {
        grid-template-columns: 1fr 1fr;
    }

    .lvn-daiminhnhat-nav button {
        width: 30%;
    }

    .lvn-daiminhnhat-nav button span.text {
        display: none;
    }

    .lvn-daiminhnhat-main-content {
        padding: 15px 0;
    }
}

/**
 * --------------------------------------
 *  Lịch tháng đại minh nhật  
 * --------------------------------------
 * */


#lvn-daiminhnhat-month-section {
    padding: 10px;
    position: relative;
    z-index: 1;
}


/* Style riêng cho phần Chi tiết ngày / Danh sách lọc (giữ lại) */
#lvn-daiminhnhat-month-section .lvn-note {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.3rem 0.5rem;
}

/* Loading animation  */
/* Loading styles for Dai Minh Nhat */
#lvn-daiminhnhat-month-section.loading {
    background: rgba(0, 0, 0, 0.5);
    min-height: 300px;
}

#lvn-daiminhnhat-month-section.loading:before {
    content: "";
    display: flex;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
}

/* Spinner */
#lvn-daiminhnhat-month-section.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-bottom-color: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: lvn-spin 1s linear infinite;
    z-index: 10;
}

@keyframes lvn-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* End Loading animation  */


@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }

}

.lvn-month-info-bar {
    padding: 10px 0;
    display: block;
    text-align: center;
}

/*Lịch tháng đại minh nhật = list ( filter = true) */
/* Danh sách Đại Minh Nhật */
.lvn-daiminhnhat-list-container {
    overflow: hidden;
}

.lvn-daiminhnhat-list-container .lvn-daiminhnhat-list-header {
    padding: 25px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
}

.lvn-daiminhnhat-list-container .lvn-daiminhnhat-list-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.lvn-daiminhnhat-list-container .lvn-month-name {
    font-weight: 700;
}

.lvn-daiminhnhat-list-container .lvn-year {
    opacity: 0.9;
}

.lvn-daiminhnhat-list-container .lvn-daiminhnhat-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    display: inline-block;
    font-size: 16px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lvn-daiminhnhat-list-container .lvn-daiminhnhat-count .lvn-count {
    font-size: 24px;
    font-weight: bold;
    margin: 0 5px;
}

.lvn-daiminhnhat-list-container .lvn-month-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.lvn-daiminhnhat-list-container .lvn-month-selector select {
    padding: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    min-width: 120px;
}

.lvn-daiminhnhat-list-container .lvn-daiminhnhat-item {
    margin-bottom: 15px;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.5rem;
}

.lvn-daiminhnhat-list-container .lvn-item-header {
    display: flex;
    justify-content: space-between;
    width: 80%
}

.lvn-daiminhnhat-list-container .lvn-nguhanh-info {
    width: 10%;
    text-align: center;
    display: flex;
    align-content: center;
    align-items: center;
    justify-content: center;
}

.lvn-daiminhnhat-list-container .lvn-daiminhnhat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.lvn-daiminhnhat-list-container .lvn-month-navigation {
    display: flex;
    justify-content: space-between;
    background: rgba(58, 57, 57, 0.2);
    padding: 0.5rem 0;
}

.lvn-daiminhnhat-list-container .lvn-month-nav {
    width: 50%;
    display: flex;
    justify-content: space-between;
}

.lvn-daiminhnhat-list-container .lvn-month-nav button {
    width: 33% !important;
    border: none;
}

.lvn-daiminhnhat-list-container .lvn-month-selector {
    display: flex;
    justify-content: space-between;
    width: 45%;
    align-items: center;
}

.lvn-daiminhnhat-list-container .lvn-month-selector>* {
    width: 33%;
}

.lvn-daiminhnhat-list-container .lvn-month-selector select {
    border: 1px solid #dbdbdb;
    border-radius: 0;
}

.lvn-daiminhnhat-list-container .lvn-month-nav button,
.lvn-daiminhnhat-list-container .lvn-month-selector select,
.lvn-daiminhnhat-list-container .lvn-month-selector button {
    height: 35px;
    font-size: 1rem;
    padding: 0 5px 0 0;
}

.lvn-daiminhnhat-item button {
    border: 0;
    height: 35px;
}






.lvn-filter-toggle {
    display: flex;
    justify-content: flex-start;
    margin: 15px 0;
}

.lvn-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    user-select: none;
}

/* Ẩn checkbox gốc */
.lvn-toggle input {
    display: none;
}

/* Thanh toggle */
.lvn-slider {
    width: 46px;
    height: 24px;
    background: #ccc;
    border-radius: 999px;
    position: relative;
    transition: all 0.3s ease;
}

/* Nút tròn */
.lvn-slider::before {
    content: "";
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

/* Khi bật */
.lvn-toggle input:checked+.lvn-slider {
    background: linear-gradient(135deg, #ff9800, #ff5722);
}

.lvn-toggle input:checked+.lvn-slider::before {
    transform: translateX(22px);
}

/* Text khi bật */
.lvn-toggle input:checked~.lvn-toggle-label {
    color: #ff5722;
    font-weight: 600;
}

/* Hover */
.lvn-toggle:hover .lvn-slider {
    box-shadow: 0 0 0 4px rgba(255, 87, 34, .15);
}

.lvn-item-actions button {
    background-color: #252525 !important;
    color: #ebeeee;
    padding: 0.1rem 0.8rem !important;
    border-radius: 12px;
    font-size: 0.8rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

@media (min-width:768px) {
    .lvn-daiminhnhat-wrapper {
        padding: 20px;
    }

    /* Header spacing & sizing moved to common css */


}

@media (max-width:768px) {

    .lvn-daiminhnhat-wrapper,
    .lvn-daiminhnhat-month-section {
        padding: 0px;
    }

    #lvn-daiminhnhat-month-section .lvn-wrapper {
        padding: 0;
        margin: 0.3rem;
        font-size: 0.9rem;
    }



    .lvn-daiminhnhat-list-header,
    .lvn-month-navigation {
        flex-direction: column;
    }

    .lvn-month-navigation .lvn-month-nav,
    .lvn-month-navigation .lvn-month-selector {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 5px;
    }

    .lvn-month-navigation .lvn-month-nav>*,
    .lvn-month-navigation .lvn-month-selector>* {
        width: 33%;
        height: 35px;
        line-height: 35px;
    }




    #lvn-daiminhnhat-month-section .lvn-day-columns {
        grid-template-columns: 1fr 1fr;
        gap: 16px
    }

    #lvn-daiminhnhat-month-section .lvn-solar-day {
        font-size: 36px
    }

    #lvn-daiminhnhat-month-section .lvn-lunar-day {
        font-size: 28px
    }

    /* Style cho Danh sách Đại Minh Nhật trên mobile (giữ lại) */
    .lvn-daiminhnhat-item {
        flex-direction: column;
        border-bottom: 1px dashed #dbdbdb;
    }

    .lvn-daiminhnhat-item .lvn-item-header {
        width: 100%;
        justify-content: space-between;
        display: flex;
        flex-direction: column;
        position: relative;
    }

    .lvn-daiminhnhat-item .lvn-item-header>div {
        margin: 5px 0px;
    }

    .lvn-daiminhnhat-item .lvn-item-header .lvn-nguhanh-info {
        display: block;
        position: absolute;
        top: 0px;
        right: 0px;
        padding: 2px 5px;
        box-sizing: border-box;
        min-width: 50px;
        font-size: 12px;
    }

    .lvn-date-info {
        display: flex;
        justify-content: space-between;
    }

    .lvn-daiminhnhat-item .lvn-item-footer {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .lvn-daiminhnhat-item {
        position: relative;
    }

    .lvn-item-actions {
        position: absolute;
        bottom: 0px;
        right: 0px;
    }

    #lvn-daiminhnhat-month-section .legend::before {
        content: '';
        width: 10px;
        height: 10px;
        top: 0px;
        left: 0px;
    }

    .lvn-month-footer {
        margin-bottom: 10px;
        font-size: 13px;
    }

    #lvn-daiminhnhat-month-section .legend::before {
        margin-right: 5px;
    }

    h2.lvn-daiminhnhat-title {
        flex-direction: column;
        width: 100%;
    }
}