/* Rakan Docs Popup - Apple Store Style */

/* Floating Button */
.rakan-docs-popup-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #2d5f3f; /* Medium dark green */
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
}

.rakan-docs-popup-button:hover {
    background: #234a32;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.rakan-docs-popup-button svg {
    color: #ffffff;
}

/* Overlay */
.rakan-docs-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rakan-docs-popup-overlay.active {
    display: block;
    opacity: 1;
}

/* Popup Panel */
.rakan-docs-popup-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.rakan-docs-popup-panel.active {
    transform: translateY(0);
}

/* Header */
.rakan-docs-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.rakan-docs-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
}

.rakan-docs-popup-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.rakan-docs-popup-close:hover {
    background: #f5f5f7;
}

.rakan-docs-popup-close svg {
    color: #86868b;
}

/* Search */
.rakan-docs-popup-search {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    gap: 8px;
}

.rakan-docs-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: border-color 0.2s ease;
}

.rakan-docs-search-input:focus {
    outline: none;
    border-color: #2d5f3f;
}

.rakan-docs-search-button {
    padding: 10px 20px;
    background: #2d5f3f;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.rakan-docs-search-button:hover {
    background: #234a32;
}

/* Content */
.rakan-docs-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.rakan-docs-loading {
    text-align: center;
    padding: 40px 20px;
    color: #86868b;
    font-size: 14px;
}

.rakan-docs-empty {
    text-align: center;
    padding: 40px 20px;
    color: #86868b;
    font-size: 14px;
}

/* Results */
.rakan-docs-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rakan-docs-item {
    padding: 16px;
    background: #f5f5f7;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.rakan-docs-item:hover {
    background: #e8e8ed;
}

.rakan-docs-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 8px 0;
}

.rakan-docs-item-title a {
    color: #1d1d1f;
    text-decoration: none;
}

.rakan-docs-item-title a:hover {
    color: #2d5f3f;
}

.rakan-docs-item-excerpt {
    font-size: 14px;
    color: #515154;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.rakan-docs-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.rakan-docs-item-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #ffffff;
    border-radius: 6px;
    font-size: 12px;
    color: #515154;
}

.rakan-docs-item-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #2d5f3f;
    text-decoration: none;
    font-weight: 500;
}

.rakan-docs-item-link:hover {
    text-decoration: underline;
}

.rakan-docs-item-content {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #d2d2d7;
    font-size: 14px;
    line-height: 1.6;
    color: #1d1d1f;
    max-height: 300px;
    overflow-y: auto;
}

.rakan-docs-item-content img,
.rakan-docs-item-content gif {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

/* Scrollbar */
.rakan-docs-popup-content::-webkit-scrollbar,
.rakan-docs-item-content::-webkit-scrollbar {
    width: 6px;
}

.rakan-docs-popup-content::-webkit-scrollbar-track,
.rakan-docs-item-content::-webkit-scrollbar-track {
    background: transparent;
}

.rakan-docs-popup-content::-webkit-scrollbar-thumb,
.rakan-docs-item-content::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 3px;
}

.rakan-docs-popup-content::-webkit-scrollbar-thumb:hover,
.rakan-docs-item-content::-webkit-scrollbar-thumb:hover {
    background: #86868b;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .rakan-docs-popup-panel {
        width: 100%;
        max-width: 100%;
        height: 80vh;
        border-radius: 16px 16px 0 0;
    }
    
    .rakan-docs-popup-button {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
    }
}
