@import url('asset/fonts/vazirmatn/Vazirmatn-font-face.css');

:root {
    --text-main: #1a1b1e;
    --text-muted: #5c5f66;
    --accent-color: #6366f1; /* More sophisticated Indigo */
    --glass-bg: rgba(255, 255, 255, 0.5); /* Whiter/Less transparent */
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

*, body, html {
    font-family: 'Vazirmatn', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: var(--text-main);
    direction: rtl;
}

#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #fff;
    overflow: hidden;
}

#bg-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.main-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.glass-frame {
    width: 92.5%;
    max-width: 1325px;
    height: auto;
    aspect-ratio: 9 / 6; /* 3:2 Ratio */
    max-height: 90vh; 
    background: var(--glass-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: translateZ(0); /* Force GPU Layer */
}

@media (max-aspect-ratio: 1/1), (max-width: 768px) {
    body, html {
        overflow: hidden !important;
        height: 100% !important;
    }
    .main-wrapper {
        height: 100vh;
        width: 100vw;
        padding: 10px; /* Reduced to provide more room on small screens */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    .glass-frame {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        max-height: none;
        margin: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        border-radius: 30px;
    }
    .nav-tabs {
        padding: 15px 15px !important; /* Reduced slightly to give room for larger fonts */
        gap: 14px !important; /* Increased for better spacing as requested */
        overflow-x: visible !important;
        justify-content: center !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        flex-wrap: nowrap;
        width: 100%;
        box-sizing: border-box !important;
    }
    .nav-tabs li {
        white-space: nowrap;
        padding-bottom: 5px;
        flex-shrink: 1;
        text-align: center;
    }
    .nav-tabs li.active::after {
        height: 3px; /* Slightly thicker line for the active tab */
    }
    .content-area {
        flex: 1;
        overflow-y: auto;
        padding: 0 5px; /* Minimized to 5px as requested */
    }
    /* Biography Section Fixes */
    .hero-content {
        flex-direction: column;
        padding: 15px 0;
        gap: 25px;
        align-items: center;
    }
    .hero-text {
        order: 2; /* Text comes second */
        width: 100%;
    }
    .hero-text h1 {
        margin-bottom: 5px !important;
        text-align: center;
    }
    .hero-text .bio-brief {
        margin-bottom: 12px !important;
        text-align: center;
    }
    .bio-list {
        border-right: none;
        padding: 0;
        text-align: right;
        width: fit-content;
        margin: 30px auto 30px auto !important; /* Optimized vertical spacing */
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .bio-list li {
        margin-bottom: 0 !important;
        justify-content: flex-start;
        width: 100%;
    }
    .profile-container {
        order: 1;
        width: clamp(140px, 30vh, 180px); /* Height-responsive image */
        margin-bottom: 0px;
    }
    .cta-button {
        padding: 8px 24px !important;
        margin: 0 auto !important;
        display: block !important;
        width: fit-content !important;
    }
    
    /* Responsive height fix */
    @media (max-height: 550px) {
        .hero-content { gap: 10px; padding: 5px 0; }
        .hero-text h1 { font-size: 1.4rem !important; }
        .hero-text .bio-brief { font-size: 1rem !important; margin-bottom: 5px !important; }
        .bio-list { gap: 4px; margin-bottom: 8px !important; }
        .bio-list li { font-size: 0.85rem !important; }
        .nav-tabs { padding: 8px 10px !important; }
    }
    /* Resume and list fixes for mobile */
    .resume-section {
        padding: 15px 5px; /* Minimized horizontal padding to 5px */
    }
    .resume-heading {
        margin-bottom: 20px;
    }
    .resume-item {
        padding-right: 8px; /* Further reduced from 10px */
    }
    .resume-list li {
        padding: 8px 0;
    }
    .resume-info-box {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 15px;
    }
    /* Article Card Fixes on Mobile */
    .article-top .badge {
        font-size: 0.7rem;
        padding: 2px 10px;
    }
    .article-top {
        flex-wrap: wrap;
        gap: 10px;
    }
    .lang-en .article-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .article-top .date {
        font-size: 0.8rem;
    }
    .article-premium-card .btn, .book-premium-card .btn {
        padding: 10px 15px;
        font-size: 0.85rem;
        border-radius: 12px;
    }
    /* Contact Part Fixes */
    .link-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    .link-icon img {
        width: 16px;
        height: 16px;
    }

}

/* Nav Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    padding: 25px 0;
    list-style: none;
    gap: 35px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.nav-tabs li {
    font-size: clamp(0.95rem, 0.4vw + 0.85rem, 1.25rem); /* More noticeable adaptive range */
    font-weight: 500;
    cursor: pointer;
    padding-bottom: 8px;
    position: relative;
    color: var(--text-muted);
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.nav-tabs li:hover {
    color: var(--text-main);
}

.nav-tabs li.active {
    color: var(--accent-color);
}

.nav-tabs li.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 6vw; /* Balanced margins: half the intensity of the previous reduction */
    display: flex;
    flex-direction: column;
}

.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
    flex: 1; 
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center; /* Center everything if it's a single column, but hero is a flex-row */
}

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

/* Hero Styles */
.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px; /* Reduced gap: 10px margin for each side */
    width: 100%;
}

.profile-container {
    width: calc(250px + 12vw); /* Slower scaling speed on desktop */
    max-width: 500px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 50px rgba(76, 110, 245, 0.2);
    border: 8px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-img:hover {
    transform: scale(1.05);
}

.hero-text {
    flex: 1;
    text-align: right;
}

.slogan {
    font-size: 1.4rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #6366f1, #fb7185); /* Indigo to Rose gradient */
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-text h1 {
    font-size: clamp(1.6rem, 2.5vw + 0.8rem, 2.9rem);
    margin-bottom: 10px;
    color: #1a1b1e;
    font-weight: 800;
    letter-spacing: -1px;
}

.specialty {
    display: none; /* Already removed from HTML, but cleaning up CSS just in case */
}

.animated-text {
    animation: slideInRight 0.8s ease-out forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bio-brief {
    font-size: clamp(0.95rem, 1.5vw + 0.5rem, 1.6rem);
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 35px;
    letter-spacing: 0.5px;
}

.bio-list {
    list-style: none;
    padding: 0;
    margin-bottom: 40px;
    border-right: 3px solid rgba(76, 110, 245, 0.2);
    padding-right: 20px;
}

.bio-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: clamp(0.85rem, 0.5vw + 0.75rem, 1.1rem);
    color: var(--text-main);
    font-weight: 500;
}

.bio-list li .blinking-dot {
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    flex-shrink: 0;
}

.license-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color) !important;
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 0.9rem;
    margin-right: 0px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.license-link:hover {
    background: var(--accent-color);
    color: #fff !important;
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

.cta-button {
    display: inline-block;
    padding: 12px 38px;
    background: rgba(255, 255, 255, 0.2); /* More substance to the glass */
    backdrop-filter: blur(25px) saturate(200%) url(#liquid-glass-refraction);
    -webkit-backdrop-filter: blur(25px) saturate(200%) url(#liquid-glass-refraction);
    border-radius: 12px;
    text-decoration: none;
    color: var(--accent-color); /* Indigo text for high contrast and pop */
    font-size: clamp(0.9rem, 0.3vw + 0.85rem, 1.05rem);
    font-weight: 800;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1.2px solid rgba(255, 255, 255, 0.9); /* Narrower, more elegant glass edge */
    box-shadow: 
        0 15px 35px rgba(99, 102, 241, 0.2), /* Soft Indigo glow pulse */
        0 5px 15px rgba(0, 0, 0, 0.05),
        inset 0 -4px 10px rgba(255, 255, 255, 0.3),
        inset 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 1;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5); /* Subtle lift for the text */
}

/* Moving Liquid Shine Beam (Label stays static) */
.cta-button::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -150%;
    width: 250%;
    height: 300%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.3) 45%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.3) 55%,
        rgba(255, 255, 255, 0) 60%
    );
    filter: blur(10px);
    pointer-events: none;
    transform: rotate(25deg);
    animation: liquidShine 8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes liquidShine {
    0% { left: -250%; }
    60% { left: 150%; } /* Sweep takes 60% of the 8s duration (4.8s) for a slower, smoother look */
    100% { left: 150%; } /* Pause for the remaining 40% (3.2s) */
}

/* The High-Gloss Specular Highlight */
.cta-button::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 10%;
    right: 10%;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 10px 10px 4px 4px; /* Adjusted for rectangular shape */
    pointer-events: none;
    filter: blur(1px);
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.03);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 20px 45px rgba(0, 0, 0, 0.15),
        inset 0 -5px 15px rgba(255, 255, 255, 0.3),
        inset 0 10px 20px rgba(0, 0, 0, 0.02);
    color: var(--accent-color);
}

.cta-button:active {
    transform: translateY(-2px) scale(0.98);
    background: rgba(255, 255, 255, 0.15);
}

/* Section Title */
.section-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

/* Slider */
.slider-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: auto;
    max-height: 100%; /* Coordinate with card height */
    margin: 5px auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    direction: ltr; /* Ensure visual order is Left to Right (Back/Dots/Next) */
}

.slider-viewport {
    position: relative; /* Base for centered navigation buttons */
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
    max-height: 100%;
    margin: 0 auto;
}

.slides {
    display: flex;
    justify-content: center; /* Center the active slide */
    width: 100%;
}

.slide-item {
    display: none;
    width: fit-content;
    height: fit-content;
    max-width: 100%;
    padding: 10px; /* The requested 10px glassy frame */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    margin: 0 auto; /* Ensure centering */
}

.slide-item.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInSlide 0.4s ease;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.slide-item img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 40vh; /* Reduced from 50vh to be safer and more responsive to card size */
    display: block;
    border-radius: 10px;
    object-fit: contain;
}

.slider-nav {
    position: absolute;
    top: 50%;
    left: 50px; /* Reduced distance to bring buttons closer to the frame */
    right: 50px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.slider-btn {
    pointer-events: auto;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
}

.slider-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap; 
    pointer-events: auto;
    width: 100%;
    /* direction: ltr is inherited from .slider-container */
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Articles Enhanced Grid */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Book Premium Card */
.book-premium-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 30px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    transition: all 0.4s ease;
    transform: translateZ(0);
}

.book-premium-card:hover {
    transform: translateY(-5px) translateZ(0);
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.08),
        0 0 15px rgba(255, 255, 255, 0.2);
}

.book-cover {
    flex-shrink: 0;
    width: 160px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 5px solid rgba(255, 255, 255, 0.3);
}

.book-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.book-details {
    flex: 1;
}

.book-badge {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: inline-block;
}

.book-title {
    font-size: clamp(1.0rem, 0.4vw + 1rem, 1.25rem);
    font-weight: 600;
    margin-bottom: 15px;
    color: #313841;
}

@media (max-width: 600px) {
    .book-premium-card {
        flex-direction: column;
        align-items: center;
        padding: 20px;
        gap: 20px;
    }
    .book-cover {
        width: 120px;
    }
    .book-title {
        font-size: 1.0rem;
        text-align: center;
    }
    .book-meta {
        grid-template-columns: 1fr;
        font-size: 0.75rem;
    }
}

.book-meta {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    margin-bottom: 25px;
}

.book-meta li {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.book-meta li i {
    color: var(--accent-color);
    width: 18px;
}

@media (max-width: 600px) {
    .book-premium-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .book-meta {
        grid-template-columns: 1fr;
    }
}
.article-premium-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.article-premium-card:hover {
    transform: translateY(-5px) translateZ(0);
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(255, 255, 255, 0.2);
}

.article-premium-card.lang-en,
.article-premium-card.lang-en *:not(i):not(.fas):not(.fab):not(.far) {
    font-family: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, Arial, sans-serif !important;
}

.article-premium-card.lang-en {
    direction: ltr; /* English context */
    text-align: left;
}

.article-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.article-top .badge {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
}

.article-top .date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.article-premium-card .title {
    font-size: clamp(0.95rem, 0.2vw + 1rem, 1.15rem);
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #20242a;
}

.article-premium-card .authors, 
.article-premium-card .source {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.article-premium-card .authors i,
.article-premium-card .source i {
    color: var(--accent-color);
    width: 20px;
    text-align: center;
}

.article-premium-card .actions, .book-premium-card .actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.article-premium-card .btn, .book-premium-card .btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.4s, box-shadow 0.4s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.article-premium-card .btn.primary, .book-premium-card .btn.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    border: 1.5px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.08);
}

.article-premium-card .btn.secondary, .book-premium-card .btn.secondary {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.article-premium-card .btn:hover, .book-premium-card .btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.article-premium-card .btn.primary:hover, .book-premium-card .btn.primary:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
    transform: translateY(-3px) scale(1.03);
}

.article-premium-card .btn.secondary:hover, .book-premium-card .btn.secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-3px) scale(1.03);
}

/* Address Section Styles */
/* --- Contact Refined Layout --- */
/* --- Contact Refined Layout --- */
.contact-refined-layout {
    display: grid;
    grid-template-columns: 0.7fr 1.55fr;
    gap: 30px;
    width: 100%;
    max-width: 1100px;
    margin: 10px auto;
}

.contact-premium-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    padding: 15px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    transform: translateZ(0); /* Force GPU */
    min-height: 350px; /* Reduced for a more compact look */
}

.links-part {
    /* Header stays top naturally with flex-start */
    justify-content: flex-start;
}

.contact-premium-card .card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    margin-right: 15px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.15); /* Darker line */
    text-align: right;
}

.address-part .card-header {
    border-bottom: none;
    margin-bottom: 5px;
    padding-bottom: 0;
}

.contact-premium-card .card-title {
    font-size: clamp(1rem, 0.4vw + 0.95rem, 1.2rem);
    font-weight: 800;
    color: #4b5563;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-premium-card .card-title i {
    color: var(--accent-color);
}

.address-text {
    font-size: clamp(0.9rem, 0.3vw + 0.85rem, 1.1rem);
    color: #1f2937; /* Slightly darker yet again for better contrast */
    line-height: 1.5;
    text-align: center;
}

/* Address Visual Overlap - Condensed */
.address-visual-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    min-height: 250px;
    margin-top: 0;
}

.map-container {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
    border: 8px solid rgba(255, 255, 255, 0.4);
}

.map-container iframe {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.map-container:hover iframe {
    opacity: 1;
}

.photo-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    height: 40%; /* Exactly 1/3 of map height */
    aspect-ratio: 3 / 4; /* Maintains book/portrait ratio */
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 2;
    background: white;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.photo-overlay:hover {
    opacity: 1;
}

.photo-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.photo-overlay:hover img {
    transform: scale(1.05);
}


/* Links Grid Refined - Condensed */
.links-grid-container {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 30px; /* Adjusted gap for better horizontal spacing */
    margin: 15px 0; /* Fixed smaller margin to bring items closer to header/footer */
}



.link-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-label {
    font-size: clamp(0.8rem, 0.2vw + 0.75rem, 0.9rem);
    font-weight: 700;
    color: var(--text-main);
    border-right: 3px solid var(--accent-color);
    padding-right: 8px;
    margin-bottom: 2px;
}

.links-flex {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.contact-link-item {
    background: transparent;
    border: none;
    padding: 5px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    width: fit-content;
}

.contact-link-item:hover {
    transform: translateX(-5px);
    opacity: 0.8;
}

.link-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 0.2vw + 0.95rem, 1.15rem);
    background: rgba(0, 0, 0, 0.05);
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    transition: all 0.3s ease;
}

.link-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: grayscale(1) contrast(150%) brightness(0.5); /* Refined monochrome with better contrast */
}

.link-name {
    font-size: clamp(0.75rem, 0.2vw + 0.7rem, 0.85rem);
    font-weight: 600;
    color: var(--text-main);
}

.contact-card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 0, 0, 0.15); /* Darker line */
}

.address-part .contact-card-footer {
    border-top: none; /* Removed for address part */
}


.domestic-hint {
    font-size: clamp(0.65rem, 0.15vw + 0.6rem, 0.75rem);
    color: var(--text-muted);
    text-align: center;
    opacity: 0.75;
    margin: 0;
}


@media (max-width: 1000px) {
    .contact-refined-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .address-visual-wrapper {
        min-height: 200px;
    }

}

.address-photo:hover img {
    transform: scale(1.10); /* Zooming in slightly more on hover */
}

@media (max-width: 900px) {
    .address-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    .address-map { height: 350px; }
    .address-photo { height: 350px; }
}

/* Social Footer */
.social-footer {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start; /* Default to start for proper overflow behavior */
    gap: 12px;
    padding: 20px;
    background: rgba(255,255,255,0.25);
    border-top: 1px solid var(--glass-border);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
    cursor: grab;
}

/* Trick to center icons if they fit, but align to start (left) if they overflow */
.social-footer::before,
.social-footer::after {
    content: '';
    margin: auto;
}

.social-footer.active-dragging {
    cursor: grabbing;
    user-select: none;
}

/* Hide scrollbar for cleaner look but keep functionality */
.social-footer::-webkit-scrollbar {
    display: none;
}
.social-footer {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@media (max-width: 1100px) {
    .social-footer {
        padding: 20px 15px;
    }

    /* Slider Mobile/Portrait Grid Fix */
    .slider-container {
        padding: 0;
        width: 100%;
        overflow: visible;
        position: relative;
        margin-top: 10px;
        display: block;
    }

    .slider-viewport {
        background: transparent;
        border: none;
        box-shadow: none;
        width: 100%;
        height: auto;
        min-height: 250px; 
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: visible;
    }

    .slide-item {
        display: none;
        padding: 10px; /* 10px frame on all sides */
        width: fit-content;
        height: fit-content;
        max-width: 90%; /* Leave space for screen edges */
        margin: 0 auto;
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 15px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-sizing: border-box;
    }

    .slide-item.active {
        display: flex;
    }
    
    .slide-item img {
        height: auto;
        max-height: 45vh;
        width: auto;
        max-width: 100%; /* Respect parent padding (10px) */
        border-radius: 8px;
        object-fit: contain;
        display: block;
    }

    .slider-nav {
        position: absolute;
        top: 50%;
        left: -15px; /* Pull slightly out to not cover the certificate too much */
        right: -15px;
        transform: translateY(-50%);
        display: flex;
        justify-content: space-between;
        pointer-events: none;
        z-index: 10;
    }

    .slider-btn {
        pointer-events: auto;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.8rem;
    }

    .prev-btn { grid-area: prev; }
    .next-btn { grid-area: next; }

    .slider-dots {
        position: relative;
        margin-top: 20px;
        padding: 0;
        width: 100%;
        justify-content: center;
        display: flex;
        gap: 6px;
    }
}

.social-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03); /* Pure Refraction */
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    font-size: 1.3rem;
    text-decoration: none;
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1), background 0.7s, box-shadow 0.7s;
    
    /* 3D Glass Border Effect */
    border: 2.5px solid rgba(255, 255, 255, 0.6);
    border-top-color: rgba(255, 255, 255, 0.9); /* Highlight */
    border-bottom-color: rgba(255, 255, 255, 0.2); /* Shadow */
    
    box-shadow: 
        inset 0 4px 8px rgba(255, 255, 255, 0.4),  /* Inner highlight */
        inset 0 -4px 8px rgba(0, 0, 0, 0.05),     /* Inner depth */
        0 10px 25px rgba(0, 0, 0, 0.08);          /* Soft outer shadow */
    
    flex-shrink: 0;
    position: relative;
}

.social-circle::before {
    content: '';
    position: absolute;
    top: 5%;
    left: 15%;
    width: 70%;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
    border-radius: 50% 50% 20% 20%;
    pointer-events: none; /* Reflection glare */
}

.social-circle:hover {
    transform: translateY(-12px) scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.12),
        inset 0 0 20px rgba(255, 255, 255, 0.6);
}

.social-circle i {
    opacity: 0.8; /* Slightly more visible by default to show colors */
    transition: all 0.5s ease;
}

/* Brand Specific Colors */
.brand-instagram i { color: #E4405F; }
.brand-youtube i   { color: #FF0000; }
.brand-telegram i  { color: #0088cc; }
.brand-facebook i  { color: #1877F2; }
.brand-tiktok i    { color: #000000; }
.brand-twitter i   { color: #000000; }
.brand-pinterest i { color: #BD081C; }
.brand-vimeo i     { color: #1AB7EA; }
.brand-namasha i   { color: #12b2e1; }
.brand-virasty i   { color: #1c93e3; }
.brand-wisgoon i   { color: #da1f63; }

/* Adjust specific logo sizes to ensure they override general styles */
.social-circle.brand-aparat img {
    width: 28px !important;
    height: 28px !important;
}

.social-circle.brand-eitaa img {
    width: 26px;
    height: 26px;
}

.social-circle.brand-namasha img {
    width: 32px;
    height: 32px;
}

.social-circle.brand-virasty img {
    width: 25px;
    height: 25px;
}

.social-circle.brand-wisgoon img {
    width: 44px;
    height: 44px;
}

.social-circle img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    opacity: 0.7; /* Soft but showing colors */
    transition: all 0.5s ease;
}

.social-circle:hover i {
    opacity: 0.9;
    transform: scale(1.1);
}

.social-circle:hover img {
    opacity: 0.9;
    transform: scale(1.1);
}

/* Resume Enhanced Styles */
.resume-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 20px 0;
    width: 100%; /* Ensure it fills the container width */
}

.resume-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15); /* Thinner and lighter border */
}

.resume-heading {
    color: var(--accent-color);
    font-size: clamp(1.1rem, 0.5vw + 1rem, 1.4rem);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid rgba(76, 110, 245, 0.2);
    padding-bottom: 10px;
}

.resume-heading i {
    font-size: 1.2rem;
}

.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}



.resume-item {
    margin-bottom: 20px;
    position: relative;
    padding-right: 20px;
    border-right: 2px solid rgba(0,0,0,0.05);
}

.resume-year {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.resume-detail strong {
    display: block;
    font-size: clamp(0.95rem, 0.3vw + 0.9rem, 1.1rem);
    margin-bottom: 5px;
    color: var(--text-main);
}

.resume-detail p {
    font-size: clamp(0.85rem, 0.2vw + 0.85rem, 0.95rem);
    color: var(--text-muted);
    margin: 0;
}

.resume-list {
    list-style: none;
    padding: 0;
}

.resume-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    font-size: clamp(0.85rem, 0.3vw + 0.85rem, 1rem);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#edu .resume-list li {
    display: block;
    position: relative;
    padding-right: 20px;
}

#edu .resume-list li::before {
    position: absolute;
    right: 0;
    top: 10px;
}

#edu .resume-list li strong {
    display: block;
    margin-bottom: 4px;
}

.resume-list li::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
}

.resume-info-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2); /* Added light border */
}

.info-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.info-item span {
    font-weight: 700;
    font-size: clamp(0.95rem, 0.3vw + 0.9rem, 1.1rem);
}

@media (max-width: 992px) {
    .resume-grid {
        grid-template-columns: 1fr;
    }
}


/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    animation: zoomIn 0.3s ease forwards;
}

@keyframes zoomIn {
    to { transform: scale(1); }
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: 0.3s;
}

.close-lightbox:hover {
    color: var(--accent-color);
}

.slide-item img {
    cursor: zoom-in;
}

/* Final Mobile Overrides (ensuring they take precedence) */
@media (max-aspect-ratio: 1/1), (max-width: 1024px) {
    .resume-heading {
        font-size: 1.2rem !important;
    }
    .is-android .main-wrapper {
        padding-bottom: 70px !important; /* Added to prevent Android nav overlap */
    }
    .is-ios .main-wrapper {
        padding-bottom: 30px !important; /* Added to prevent iOS home indicator overlap */
    }
}
/* --- GLOBAL DELUXE BALLOON TOOLTIP (JS POWERED) --- */
#global-tooltip {
    position: fixed;
    background: rgba(255, 255, 255, 0.5); /* Reduced Transparency */
    color: #656565; /* Softer, more delicate grey text */ 
    padding: 7px 18px;
    border-radius: 14px;
    font-size: 0.82rem;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: 
        opacity 0.2s ease, 
        visibility 0.2s, 
        transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    
    /* filter: drop-shadow unifies the triangle and bubble into one piece */
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    
    border: none;
    z-index: 999999 !important;
    pointer-events: none;
    transform: translate(-50%, -85%);
}

#global-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; /* Positioned exactly at the edge to avoid dark overlap lines */
    left: 50%;
    transform: translateX(-50%);
    border-width: 7px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.6) transparent transparent transparent;
}

#global-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, calc(-100% - 35px)); /* Increased to 35px gap */
}
