/* ===========================
   SZEKELY TAB NAVIGATION
   Modern & Stylish Design
   =========================== */

/* CRITICAL: Z-index hierarchy to prevent conflicts with other menus */
.szekely-tab-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1; /* Lower than menus */
}

/* Ensure tab elements don't block clicks outside their bounds */
.szekely-tab-container,
.szekely-tab-nav,
.szekely-tab-content,
.szekely-tab-panel {
    pointer-events: auto; /* Only block where elements actually are */
}

.szekely-error {
    background: #ffebee;
    border: 2px solid #f44336;
    border-radius: 15px;
    padding: 1.5rem;
    color: #c62828;
    font-weight: 600;
    text-align: center;
}

/* Tab Navigation */
.szekely-tab-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--color-three) 0%, var(--color-one) 100%);
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(1, 58, 99, 0.1);
    position: relative;
    z-index: 1; /* Lower than fixed menus */
}

.szekely-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--color-one);
    border: 2px solid var(--color-three);
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-two);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    z-index: 1; /* Lower than menus */
}

.szekely-tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(2, 73, 124, 0.1), transparent);
    transition: left 0.5s ease;
}

.szekely-tab-btn:hover::before {
    left: 100%;
}

.szekely-tab-btn i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.szekely-tab-btn:hover {
    background: var(--color-two);
    color: var(--color-one);
    border-color: var(--color-two);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(1, 58, 99, 0.3);
}

.szekely-tab-btn:hover i {
    transform: scale(1.2) rotate(10deg);
}

.szekely-tab-btn.active {
    background: var(--color-four);
    color: var(--color-one);
    border-color: var(--color-four);
    box-shadow: 
        0 4px 15px rgba(2, 73, 124, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.szekely-tab-btn.active i {
    animation: tabIconPulse 1.5s ease-in-out infinite;
}

@keyframes tabIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Tab Content */
.szekely-tab-content {
    position: relative;
    min-height: 400px;
    z-index: 1; /* Lower than fixed menus */
}

/* CRITICAL: Ensure Google Meet menus stay on top - MAXIMUM SPECIFICITY */
body #gmsm-side-menu,
body .gmsm-side-menu,
body #gmsm-user-menu,
body .gmsm-user-menu,
body #gmsm-user-dropdown,
body .gmsm-dropdown,
body #gmsm-toggle-side-menu,
body .gmsm-toggle-button,
body #floating-menu {
    z-index: 10000 !important; /* Higher than tab navigation */
    pointer-events: auto !important; /* Ensure clickability */
    position: fixed !important; /* Fixed positioning for menus */
}

/* CRITICAL: Side menu must stay constrained */
body #gmsm-side-menu,
body .gmsm-side-menu {
    width: 200px !important;
    max-width: 250px !important;
    right: -250px !important; /* Hidden by default */
    transition: right 0.3s ease-in-out !important;
    overflow: hidden !important;
}

body #gmsm-side-menu.expanded,
body .gmsm-side-menu.expanded {
    right: 0 !important; /* Slide in when expanded */
}

body #gmsm-user-avatar,
body .gmsm-avatar,
body button#gmsm-user-avatar,
body button.gmsm-avatar {
    z-index: 10001 !important; /* Even higher for clickability */
    pointer-events: auto !important; /* Ensure clickability */
    position: fixed !important; /* Fixed positioning */
    cursor: pointer !important; /* Show it's clickable */
}

body #gmsm-user-dropdown,
body .gmsm-dropdown,
body div.gmsm-dropdown {
    z-index: 10002 !important; /* Highest for dropdown */
    pointer-events: auto !important; /* Ensure clickability */
    position: absolute !important; /* Absolute relative to parent */
}

/* Force all child elements to be clickable */
body .gmsm-side-menu,
body .gmsm-side-menu *,
body .gmsm-user-menu,
body .gmsm-user-menu *,
body .gmsm-avatar,
body .gmsm-avatar *,
body .gmsm-dropdown,
body .gmsm-dropdown *,
body #floating-menu,
body #floating-menu *,
body .gmsm-toggle-button,
body .gmsm-toggle-button * {
    pointer-events: auto !important; /* Force all child elements to be clickable */
}

/* CRITICAL: Ensure page content is not covered */
body main,
body .site-content,
body article,
body .entry-content {
    position: relative !important;
    z-index: 1 !important;
}

/* CRITICAL: Toggle button positioning */
body #gmsm-toggle-side-menu,
body .gmsm-toggle-button {
    position: fixed !important;
    right: 0 !important;
    top: 3.5em !important;
    z-index: 10000 !important;
}

.szekely-tab-panel {
    display: none;
    opacity: 0;
}

.szekely-tab-panel.active {
    display: block;
    animation: tabFadeIn 0.4s ease forwards;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Text Content Styling */
.szekely-text-content {
    background: var(--color-one);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(1, 58, 99, 0.08);
    border: 1px solid var(--color-three);
    line-height: 1.8;
    color: #333;
}

.szekely-text-content h1,
.szekely-text-content h2,
.szekely-text-content h3,
.szekely-text-content h4 {
    color: var(--color-two);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.szekely-text-content h1 { font-size: 2rem; }
.szekely-text-content h2 { font-size: 1.75rem; }
.szekely-text-content h3 { font-size: 1.5rem; }
.szekely-text-content h4 { font-size: 1.25rem; }

.szekely-text-content p {
    margin-bottom: 1rem;
}

.szekely-text-content a {
    color: var(--color-four);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.szekely-text-content a:hover {
    color: var(--color-two);
}

.szekely-text-content ul,
.szekely-text-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.szekely-text-content li {
    margin-bottom: 0.5rem;
}

.szekely-text-content blockquote {
    border-left: 4px solid var(--color-four);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #555;
}

.szekely-text-content code {
    background: var(--color-three);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

.szekely-text-content pre {
    background: var(--color-three);
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1rem 0;
}

/* Shortcode Content Styling */
.szekely-shortcode-content {
    background: var(--color-one);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(1, 58, 99, 0.08);
    border: 1px solid var(--color-three);
}

.szekely-shortcode-content > *:first-child {
    margin-top: 0;
}

.szekely-shortcode-content > *:last-child {
    margin-bottom: 0;
}

/* Mixed Content Styling (Text + Shortcode) */
.szekely-mixed-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.szekely-mixed-text {
    background: var(--color-one);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(1, 58, 99, 0.08);
    border: 1px solid var(--color-three);
    line-height: 1.8;
    color: #333;
}

.szekely-mixed-text h1,
.szekely-mixed-text h2,
.szekely-mixed-text h3,
.szekely-mixed-text h4 {
    color: var(--color-two);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.szekely-mixed-text h1:first-child,
.szekely-mixed-text h2:first-child,
.szekely-mixed-text h3:first-child,
.szekely-mixed-text h4:first-child {
    margin-top: 0;
}

.szekely-mixed-text h1 { font-size: 2rem; }
.szekely-mixed-text h2 { font-size: 1.75rem; }
.szekely-mixed-text h3 { font-size: 1.5rem; }
.szekely-mixed-text h4 { font-size: 1.25rem; }

.szekely-mixed-text p {
    margin-bottom: 1rem;
}

.szekely-mixed-text a {
    color: var(--color-four);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.szekely-mixed-text a:hover {
    color: var(--color-two);
}

.szekely-mixed-text ul,
.szekely-mixed-text ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.szekely-mixed-text li {
    margin-bottom: 0.5rem;
}

.szekely-mixed-shortcode {
    background: var(--color-one);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(1, 58, 99, 0.08);
    border: 1px solid var(--color-three);
}

.szekely-mixed-shortcode > *:first-child {
    margin-top: 0;
}

.szekely-mixed-shortcode > *:last-child {
    margin-bottom: 0;
}

/* Posts Container */
.szekely-posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.szekely-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--color-three);
    border-radius: 15px;
    color: var(--color-two);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Post Item */
.szekely-post-item {
    background: var(--color-one);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(1, 58, 99, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--color-three);
    display: flex;
    flex-direction: column;
    height: 100%; /* Uniform height */
}

.szekely-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(1, 58, 99, 0.15);
    border-color: var(--color-four);
}

/* Compact thumbnail for posts with images */
.szekely-post-thumbnail {
    width: 100%;
    height: 150px; /* Reduced from 220px for more compact look */
    overflow: hidden;
    position: relative;
    display: block;
    flex-shrink: 0; /* Don't shrink */
}

.szekely-post-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(1, 58, 99, 0.7));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.szekely-post-item:hover .szekely-post-thumbnail::after {
    opacity: 1;
}

.szekely-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.szekely-post-item:hover .szekely-post-thumbnail img {
    transform: scale(1.1);
}

.szekely-post-content {
    padding: 1.5rem;
    flex-grow: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
}

/* Text-only posts have more padding at top to compensate for no image */
.szekely-post-item.text-only .szekely-post-content {
    padding: 2rem 1.5rem;
}

/* SEO-only title (hidden visually but accessible to search engines) */
.szekely-post-title.szekely-seo-only {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Category link (displayed instead of title) */
.szekely-post-category {
    margin: 0 0 0.75rem;
}

.szekely-post-category a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-four);
    color: var(--color-one);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.szekely-post-category a:hover {
    background: var(--color-two);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(1, 58, 99, 0.3);
}

.szekely-post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #666;
}

.szekely-post-meta i {
    margin-right: 0.25rem;
    color: var(--color-four);
}

/* Make excerpt clickable */
.szekely-post-excerpt-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    flex-grow: 1; /* Take remaining space */
}

.szekely-post-excerpt {
    color: #555;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.szekely-post-excerpt-link:hover .szekely-post-excerpt {
    color: var(--color-four);
}

/* Loading Indicator */
.szekely-loading {
    text-align: center;
    padding: 2rem;
}

.szekely-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--color-three);
    border-top-color: var(--color-four);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.szekely-loading p {
    color: var(--color-two);
    font-weight: 600;
}

/* End Message */
.szekely-end-message {
    text-align: center;
    padding: 2rem;
    background: var(--color-three);
    border-radius: 15px;
    margin-top: 2rem;
}

.szekely-end-message p {
    color: var(--color-two);
    font-weight: 600;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .szekely-tab-nav {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .szekely-tab-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
    }
    
    .szekely-posts-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .szekely-post-thumbnail {
        height: 180px;
    }
    
    .szekely-text-content,
    .szekely-shortcode-content,
    .szekely-mixed-text,
    .szekely-mixed-shortcode {
        padding: 1.5rem;
    }
    
    .szekely-mixed-content {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .szekely-tab-btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }
    
    .szekely-tab-btn i {
        font-size: 1.1rem;
    }
    
    .szekely-post-content {
        padding: 1.25rem;
    }
    
    .szekely-text-content,
    .szekely-shortcode-content,
    .szekely-mixed-text,
    .szekely-mixed-shortcode {
        padding: 1.25rem;
    }
    
    .szekely-text-content h1,
    .szekely-mixed-text h1 { font-size: 1.5rem; }
    .szekely-text-content h2,
    .szekely-mixed-text h2 { font-size: 1.35rem; }
    .szekely-text-content h3,
    .szekely-mixed-text h3 { font-size: 1.2rem; }
    
    .szekely-mixed-content {
        gap: 1.25rem;
    }
}