/*
====================
Components: Shared UI Components
====================
*/

/* ===================================
   Search Modal
   =================================== */

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.search-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.search-modal-title i {
    color: var(--color-primary-light);
    margin-right: 6px;
}

.search-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0 4px;
}

.search-modal-close:hover {
    color: #fff;
}

.search-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.search-modal-input-wrap {
    margin-bottom: 12px;
}

.search-modal-input-wrap input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    outline: none;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.search-modal-input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-modal-input-wrap input:focus {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.2);
}

.search-suggestions {
    margin-bottom: 12px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: #fff;
    border-radius: 8px;
    transition: background 0.1s ease;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.suggestion-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    object-fit: cover;
    flex-shrink: 0;
}

.suggestion-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.no-suggestions {
    text-align: center;
    color: var(--color-text-lighter);
    font-size: 14px;
    padding: 16px 0;
}

.search-modal-footer {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.search-browse-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--color-link);
    text-decoration: none;
    font-weight: 500;
}

.search-browse-link:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

.search-results .search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    transition: background 0.15s ease;
}

.search-results .search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ===================================
   Notification Toast
   =================================== */

.notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(34, 34, 34, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===================================
   Lightbox Overlay
   =================================== */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-container img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* ===================================
   Breadcrumbs
   =================================== */

.breadcrumbs,
.breadcrumb {
    font-size: 13px;
    color: var(--color-text-lighter);
    margin-bottom: 20px;
    padding: 10px 0;
}

.breadcrumbs a,
.breadcrumb a {
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover,
.breadcrumb a:hover {
    color: var(--color-link);
}

.breadcrumbs .separator,
.breadcrumb .separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.3);
}

/* ===================================
   Social Share
   =================================== */

.social-share-bar {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.share-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 0.85;
    text-decoration: none;
    color: #fff;
}

.share-btn.share-twitter { background: #1DA1F2; }
.share-btn.share-facebook { background: #1877F2; }
.share-btn.share-line { background: #06C755; }
.share-btn.share-copy { background: rgba(255, 255, 255, 0.1); }

/* ===================================
   Entry Content Typography
   =================================== */

.entry-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
}

.entry-content h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 24px 0 12px;
}

.entry-content p {
    margin-bottom: 16px;
    line-height: 1.9;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
}

.entry-content ul,
.entry-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.entry-content li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 16px 24px;
    margin: 16px 0;
    background: rgba(65, 105, 225, 0.05);
    border-radius: 0 6px 6px 0;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.entry-content th,
.entry-content td {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.entry-content th {
    background: rgba(65, 105, 225, 0.1);
    font-weight: 700;
}

.entry-content a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-color: rgba(96, 165, 250, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s;
}

.entry-content a:hover {
    text-decoration-color: var(--color-link);
}

.entry-content pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.6;
}

.entry-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* ===================================
   Focus & Accessibility
   =================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100001;
    padding: 10px 20px;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    border-radius: 0 0 6px 6px;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ===================================
   Selection & Scrollbar
   =================================== */

::selection {
    background: rgba(65, 105, 225, 0.3);
    color: #fff;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ===================================
   Utility
   =================================== */

body.menu-open {
    overflow: hidden;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    .site-header,
    .site-footer-gw,
    .back-to-top,
    .mobile-drawer,
    .mobile-menu-overlay,
    .search-modal {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}

/* ===================================
   Responsive
   =================================== */

@media screen and (max-width: 768px) {
    .search-modal {
        padding-top: 40px;
    }

    .search-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .search-modal-input-wrap input {
        font-size: 15px;
        padding: 10px 14px;
    }

    .social-share-bar {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .share-btn {
        min-width: calc(50% - 4px);
    }
}