/* Fix for Sidebar Layout */
.sidebar {
    position: sticky;
    top: 100px; /* Header height + gap */
    max-height: calc(100vh - 120px); /* Viewport height - header - padding */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--muted, #9ca3af) var(--card, #111827);
    padding-right: 10px; /* Space for scrollbar */
    border-right: 1px solid var(--border, #1f2937); /* Add border for separation */
    background: var(--bg, #0b0c0f); /* Ensure background is opaque */
    z-index: 10;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--card, #111827);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border, #1f2937);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--brand, #4f46e5);
}

/* Ensure layout grid supports sticky sidebar */
.layout {
    align-items: start; /* Prevent sidebar from stretching to full container height if not sticky */
}

.contact-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.contact-modal-content {
    background: var(--card, #111827);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    border: 1px solid var(--border, #1f2937);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-modal-overlay.active .contact-modal-content {
    transform: scale(1);
}

.contact-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border, #1f2937);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.contact-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fg, #f3f4f6);
}

.contact-modal-close {
    background: none;
    border: none;
    color: var(--muted, #9ca3af);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 8px;
    transition: all 0.2s;
}

.contact-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fg, #f3f4f6);
}

.contact-modal-body {
    padding: 24px;
}

.contact-modal-desc {
    color: var(--muted, #9ca3af);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.contact-modal-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-link {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border, #1f2937);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 16px;
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    border-color: var(--brand, #4f46e5);
}

.contact-link .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-link.whatsapp .icon-box {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
}

.contact-link.phone .icon-box {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.contact-link.mail .icon-box {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.contact-link .link-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-link .link-text strong {
    color: var(--fg, #f3f4f6);
    font-size: 1rem;
    font-weight: 600;
}

.contact-link .link-text span {
    color: var(--muted, #9ca3af);
    font-size: 0.85rem;
}

.contact-link .arrow {
    color: var(--muted, #9ca3af);
    transition: transform 0.2s;
}

.contact-link:hover .arrow {
    transform: translateX(4px);
    color: var(--brand, #4f46e5);
}

/* FAB Trigger Button */
.contact-fab-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 12px; /* Square shape globally */
    background: var(--brand, #4f46e5);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
    cursor: pointer;
    z-index: 9990; /* Keep high z-index for web */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-fab-trigger:hover {
    transform: scale(1.1) rotate(10deg);
    background: var(--brand-light, #6366f1);
}

/* Footer Fixes */
.site-footer {
    background: #0b0c0f;
    border-top: 1px solid var(--border, #1f2937);
    padding: 60px 0 30px;
    color: var(--muted, #9ca3af);
    margin-top: auto;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .brand-text {
    color: var(--fg, #f3f4f6);
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-desc {
    margin: 20px 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg, #f3f4f6);
    text-decoration: none;
    transition: all 0.2s;
}

.footer-social a:hover {
    background: var(--brand, #4f46e5);
    transform: translateY(-2px);
}

.footer-accordion-header h5 {
    color: var(--fg, #f3f4f6);
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--muted, #9ca3af);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--brand, #4f46e5);
    transform: translateX(4px);
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.contact-list i {
    color: var(--brand, #4f46e5);
    font-size: 1.1rem;
    margin-top: 2px;
}

.contact-list a {
    color: var(--muted, #9ca3af);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-list a:hover {
    color: var(--brand, #4f46e5);
}

@media (max-width: 968px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-fab-trigger {
        bottom: 90px !important; /* Adjusted to sit above mobile navbar */
        width: 45px !important;
        height: 45px !important;
        border-radius: 8px !important;
    }
}
