/**
 * HP AI Summary - Professional Education & Finance Style
 * Màu sắc chuyên nghiệp, hiệu ứng tối giản
 */

/* ============================================
   TOGGLE BUTTON - Show/Hide Summary
   ============================================ */
.hp-summary-toggle-container {
    text-align: center;
    margin: 50px auto;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hp-summary-toggle-btn {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    border: none;
    padding: 16px 36px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.hp-summary-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.3);
    background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
}

.hp-summary-toggle-btn:active {
    transform: translateY(0);
}

.hp-summary-toggle-btn.active {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.toggle-icon {
    font-size: 1.3rem;
}

.toggle-arrow {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.hp-summary-toggle-btn.active .toggle-arrow {
    transform: rotate(180deg);
}

/* Dark Mode Toggle Button */
.jnews-dark-mode .hp-summary-toggle-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.jnews-dark-mode .hp-summary-toggle-btn.active {
    background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
}

/* ============================================
   WARNING MODAL - Educational Notice
   ============================================ */
.hp-summary-warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warning-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.warning-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 640px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.warning-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 20px;
}

.warning-modal-content h3 {
    font-size: 1.8rem;
    color: #1e293b;
    text-align: center;
    margin: 0 0 20px 0;
    font-weight: 700;
}

.warning-text {
    color: #475569;
    line-height: 1.7;
    font-size: 1.05rem;
}

.warning-text ul {
    list-style: none;
    padding: 0;
    margin: 18px 0;
}

.warning-text li {
    padding: 8px 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-recommendation {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    padding: 18px 22px;
    border-radius: 8px;
    margin: 20px 0;
}

.warning-note {
    color: #64748b;
    font-size: 0.95rem;
    text-align: center;
    margin-top: 18px;
    font-style: italic;
}

.warning-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.warning-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.warning-btn-cancel {
    background: #e2e8f0;
    color: #1e293b;
}

.warning-btn-cancel:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.warning-btn-proceed {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
}

.warning-btn-proceed:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
    transform: translateY(-1px);
}

.warning-remember {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #64748b;
    font-size: 0.95rem;
    cursor: pointer;
}

.warning-remember input {
    margin-right: 8px;
    cursor: pointer;
}

/* Dark Mode Modal */
.jnews-dark-mode .warning-modal-content {
    background: #1e293b;
}

.jnews-dark-mode .warning-modal-content h3 {
    color: #e2e8f0;
}

.jnews-dark-mode .warning-text {
    color: #cbd5e1;
}

.jnews-dark-mode .warning-recommendation {
    background: #1e3a5f;
    border-left-color: #3b82f6;
}

.jnews-dark-mode .warning-note {
    color: #94a3b8;
}

.jnews-dark-mode .warning-btn-cancel {
    background: #334155;
    color: #e2e8f0;
}

.jnews-dark-mode .warning-btn-proceed {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.jnews-dark-mode .warning-remember {
    color: #94a3b8;
}

/* ============================================
   HIDE BUTTON - Inside Summary
   ============================================ */
.hp-summary-hide-container {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.hp-summary-hide-btn {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e0;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.hp-summary-hide-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.jnews-dark-mode .hp-summary-hide-container {
    border-top-color: rgba(148, 163, 184, 0.2);
}

.jnews-dark-mode .hp-summary-hide-btn {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

/* ============================================
   WRAPPER - Container tổng
   ============================================ */
.hp-tomtat-wrapper {
    background: #ffffff;
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 1200px;
    margin: 50px auto;
    border: 1px solid #e5e7eb;
    border-top: 4px solid #1e40af;
}

.hp-tomtat-wrapper {
    animation: summaryFadeIn 0.4s ease;
}

@keyframes summaryFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   TITLE SECTION
   ============================================ */
.hp-title {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.entry-content .hp-title h2
{
    font-size: 2rem !important;
    color: #1e293b !important;
    margin: 0 0 12px 0 !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border: none !important;
    border-left: none !important;
    padding: 0 !important;
}
.hp-title h2::before {
    display: none !important;
    content: none !important;
}
.hp-title-icon {
    font-size: 2.2rem;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.hp-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

/* ============================================
   CARDS GRID
   ============================================ */
.hp-cards-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 30px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* ============================================
   CARD - Individual item (Enhanced Design)
   ============================================ */
.hp-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 30px 28px;
    border-radius: 12px;
    border: 2px solid #e0e7ff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

/* Decorative accent */
.hp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #2563eb 0%, #1e40af 100%);
}

.hp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
    border-color: #c7d2fe;
}

/* Container cho icon và title */
.hp-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.hp-card-icon {
    font-size: 2.2rem;
    line-height: 1;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.hp-card-title {
    font-size: 1.4rem;
    color: #0f172a;
    margin: 0;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
    flex: 1;
    max-height: 56px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


.hp-card-content {
    font-size: 1.08rem;
    color: #334155;
    line-height: 1.8;
    margin: 0;
}

.hp-card-content strong {
    color: #1e40af;
    font-weight: 700;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin: 0 2px;
}

/* ============================================
   BOTTOM LINE
   ============================================ */
.hp-bottom {
    background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
    color: #ffffff;
    padding: 24px 32px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.6;
    margin-top: 30px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.hp-bottom-icon {
    font-size: 1.4rem;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

/* ============================================
   DIVIDER
   ============================================ */
.hp-summary-divider {
    text-align: center;
    margin: 60px 0 50px;
    position: relative;
}

.hp-summary-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(37, 99, 235, 0.3) 25%, 
        rgba(37, 99, 235, 0.5) 50%, 
        rgba(37, 99, 235, 0.3) 75%, 
        transparent
    );
}

.hp-summary-divider span {
    background: #ffffff;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e40af;
    position: relative;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
    display: inline-block;
    border: 2px solid #2563eb;
}

/* AI Generated badge */
.hp-ai-generated { position: relative; }

.hp-ai-generated::after {
    content: '🤖 Thẻ ghi nhớ nhanh';
    position: absolute;
    top: 18px;
    right: 18px;
    background: #1e40af;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
}

/* ============================================
   JNEWS DARK MODE
   ============================================ */

.jnews-dark-mode .hp-tomtat-wrapper {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-color: rgba(148, 163, 184, 0.1);
    border-top-color: #2563eb;
}

.jnews-dark-mode .hp-title {
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

.jnews-dark-mode .hp-title h2 {
    color: #f1f5f9 !important;
}

.jnews-dark-mode .hp-subtitle {
    color: #94a3b8;
}

.jnews-dark-mode .hp-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.jnews-dark-mode .hp-card::before {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.jnews-dark-mode .hp-card:hover {
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.2);
    border-color: #475569;
}

.jnews-dark-mode .hp-card-icon {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
}

.jnews-dark-mode .hp-card-title {
    color: #f1f5f9;
}

.jnews-dark-mode .hp-card-content {
    color: #cbd5e1;
}

.jnews-dark-mode .hp-card-content strong {
    color: #93c5fd;
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
}

.jnews-dark-mode .hp-bottom {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
}

.jnews-dark-mode .hp-summary-divider span {
    background: #1e293b;
    color: #60a5fa;
    border-color: #3b82f6;
}

.jnews-dark-mode .hp-ai-generated::after {
    background: #2563eb;
}

/* ============================================
   RESPONSIVE - Tablet
   ============================================ */
@media (max-width: 1024px) {
    .hp-tomtat-wrapper {
        padding: 40px 32px;
        margin: 40px 20px;
    }
    .hp-title h2 {
        font-size: 1.8rem;
    }
    .hp-cards-grid {
        gap: 20px;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */
@media (max-width: 768px) {
    .hp-summary-toggle-btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .hp-tomtat-wrapper {
        padding: 32px 24px;
        margin: 30px 15px;
        border-radius: 10px;
    }
    
    .hp-title h2 {
        font-size: 1.5rem;
    }
    
    .hp-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 18px;
    }
    
    .hp-card {
        padding: 24px 20px;
    }
    
    .hp-bottom {
        padding: 20px 24px;
        font-size: 1.05rem;
    }
    
    .warning-modal-content {
        padding: 32px 24px;
    }
    
    .warning-actions {
        flex-direction: column;
    }
}

/* ============================================
   RESPONSIVE - Small Mobile
   ============================================ */
@media (max-width: 480px) {
    .hp-tomtat-wrapper {
        padding: 24px 18px;
    }
    
    .hp-title h2 {
        font-size: 1.3rem;
    }
    
    .hp-card {
        padding: 20px 16px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .hp-summary-toggle-container,
    .hp-summary-hide-btn,
    .hp-ai-generated::after {
        display: none;
    }
    
    .hp-tomtat-wrapper {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        margin: 20px 0;
        display: block !important;
    }
    
    .hp-card {
        break-inside: avoid;
    }
}

/* ============================================
   THEME COMPATIBILITY
   ============================================ */
.hp-tomtat-wrapper * {
    box-sizing: border-box;
}

.hp-tomtat-wrapper h2,
.hp-tomtat-wrapper h3 {
    font-family: inherit;
}
/* ============================================
   WARNING MODAL - Enhanced Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .warning-modal-content {
        padding: 28px 20px;
        width: 95%;
        border-radius: 10px;
    }
    
    .warning-icon {
        font-size: 3rem;
        margin-bottom: 16px;
    }
    
    .warning-modal-content h3 {
        font-size: 1.4rem;
        margin-bottom: 16px;
    }
    
    .warning-text {
        font-size: 1rem;
    }
    
    .warning-text li {
        font-size: 1rem;
        padding: 6px 0;
    }
    
    .warning-recommendation {
        padding: 14px 16px;
        margin: 16px 0;
    }
    
    .warning-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 24px;
    }
    
    .warning-btn {
        width: 100%;
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .warning-remember {
        margin-top: 16px;
        font-size: 0.9rem;
    }
    
    .warning-note {
        font-size: 0.88rem;
        margin-top: 14px;
    }
    .hp-card-icon {
    width: 48px;
    height: 48px;
    font-size: 1.8rem;
}

    .hp-card-title {
    font-size: 1.25rem;
}
}

@media (max-width: 480px) {
    .warning-modal-content {
        padding: 24px 18px;
        width: 96%;
    }
    
    .warning-icon {
        font-size: 2.5rem;
        margin-bottom: 14px;
    }
    
    .warning-modal-content h3 {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    .warning-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .warning-recommendation {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .warning-btn {
        padding: 14px 18px;
        font-size: 0.95rem;
    }
}

/* Fix overflow issues on small screens */
@media (max-width: 360px) {
    .warning-modal-content {
        padding: 20px 16px;
        max-height: 95vh;
    }
    
    .warning-icon {
        font-size: 2.2rem;
    }
    
    .warning-modal-content h3 {
        font-size: 1.15rem;
    }
}