/* ==========================================================================
   RAID BROWSER - WordPress Theme Stylesheet
   A complete browser interface theme
   ========================================================================== */

/* --------------------------------------------------------------------------
   8. GLOBAL RESET & BASE STYLES
   -------------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0a0a1a;
    color: #e6e6f0;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    font-weight: 700;
    line-height: 1.3;
}

p {
    margin: 0 0 1em;
}

a {
    color: #6c5ce7;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #a29bfe;
}

img {
    max-width: 100%;
    height: auto;
}

/* All buttons */
button {
    cursor: pointer;
    border: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    transition: all 0.2s ease;
    outline: none;
}

button:focus-visible {
    outline: 2px solid #6c5ce7;
    outline-offset: 2px;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: #0a0a1a;
}

::-webkit-scrollbar-track {
    background: #0a0a1a;
}

::-webkit-scrollbar-thumb {
    background: #2a2a45;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a5a;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #2a2a45 #0a0a1a;
}

/* --------------------------------------------------------------------------
   1. CHROME BAR (Header)
   -------------------------------------------------------------------------- */

.raid-chrome-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: #0a0a1a;
    border-bottom: 1px solid #2a2a45;
    z-index: 900;
}

/* Navigation buttons */
.raid-nav-buttons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.raid-nav-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    color: #e6e6f0;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.raid-nav-btn:hover {
    background: #1a1a35;
}

.raid-nav-btn:active {
    background: #12122b;
    transform: scale(0.95);
}

.raid-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Tabs */
.raid-tabs {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.raid-tabs::-webkit-scrollbar {
    display: none;
}

.raid-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    background: #12122b;
    color: #c8c8e0;
    font-size: 13px;
    white-space: nowrap;
    max-width: 200px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    border-bottom: 2px solid transparent;
}

.raid-tab:hover {
    background: #1a1a35;
    color: #e6e6f0;
}

.raid-tab.active {
    background: #0a0a1a;
    color: #ffffff;
    border-bottom: 2px solid #6c5ce7;
}

.raid-tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.raid-tab-favicon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.raid-tab-close {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    color: #c8c8e0;
    flex-shrink: 0;
}

.raid-tab-close:hover {
    background: #2a2a45;
    color: #ef4444;
}

.raid-tab-new {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 18px;
    color: #c8c8e0;
}

.raid-tab-new:hover {
    background: #1a1a35;
    color: #e6e6f0;
}

/* URL bar */
.raid-url-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 60%;
    margin: 0 auto;
    background: #12122b;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 4px 16px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.raid-url-bar:focus-within {
    border-color: #6c5ce7;
    background: #1a1a35;
}

.raid-url-lock {
    color: #22c55e;
    font-size: 13px;
    flex-shrink: 0;
}

.raid-url-text {
    flex: 1;
    border: none;
    background: transparent;
    color: #e6e6f0;
    font-size: 14px;
    padding: 4px 0;
}

.raid-url-text::placeholder {
    color: #6a6a85;
}

.raid-url-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.raid-url-action-btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #c8c8e0;
    font-size: 14px;
}

.raid-url-action-btn:hover {
    background: #2a2a45;
}

/* Chrome bar right side buttons */
.raid-chrome-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.raid-chrome-action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #e6e6f0;
    font-size: 16px;
}

.raid-chrome-action-btn:hover {
    background: #1a1a35;
}

/* --------------------------------------------------------------------------
   2. MAIN LAYOUT
   -------------------------------------------------------------------------- */

.raid-main {
    display: flex;
    height: calc(100vh - 48px);
    margin-top: 48px;
    overflow: hidden;
}

.raid-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #0a0a1a;
    position: relative;
}

/* AI Panel container */
.raid-ai-panel {
    width: 350px;
    background: #12122b;
    border-left: 1px solid #2a2a45;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.raid-ai-panel.collapsed {
    width: 0;
    border-left: none;
}

.raid-ai-panel.collapsed > * {
    opacity: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   3. AI PANEL
   -------------------------------------------------------------------------- */

.raid-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid #2a2a45;
    flex-shrink: 0;
}

.raid-ai-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.raid-ai-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

.raid-ai-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.raid-ai-status.online {
    color: #22c55e;
}

.raid-ai-status.offline {
    color: #ef4444;
}

/* Model select */
.raid-ai-model-wrap {
    padding: 12px 16px;
    border-bottom: 1px solid #2a2a45;
    flex-shrink: 0;
}

.raid-ai-model-select {
    width: 100%;
    background: #1a1a35;
    color: #e6e6f0;
    border: 1px solid #2a2a45;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.raid-ai-model-select:hover {
    border-color: #6c5ce7;
}

.raid-ai-model-select:focus {
    border-color: #6c5ce7;
}

.raid-ai-model-select option {
    background: #1a1a35;
    color: #e6e6f0;
}

/* Output area */
.raid-ai-output {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.raid-ai-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
}

.raid-ai-message-user {
    align-items: flex-end;
}

.raid-ai-message-user .raid-ai-bubble {
    background: #6c5ce7;
    color: #ffffff;
    border-radius: 12px 12px 4px 12px;
}

.raid-ai-message-bot .raid-ai-bubble {
    background: #1a1a35;
    color: #e6e6f0;
    border-radius: 12px 12px 12px 4px;
}

.raid-ai-bubble {
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.raid-ai-bubble code {
    background: #0a0a1a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", Menlo, monospace;
    font-size: 13px;
}

.raid-ai-bubble pre {
    background: #0a0a1a;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.raid-ai-message-time {
    font-size: 11px;
    color: #6a6a85;
    padding: 0 4px;
}

/* Input row */
.raid-ai-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #2a2a45;
    padding: 8px;
    flex-shrink: 0;
}

.raid-ai-input {
    flex: 1;
    border: 1px solid #2a2a45;
    border-radius: 8px;
    background: #1a1a35;
    color: #e6e6f0;
    padding: 10px 14px;
    font-size: 14px;
    resize: none;
    transition: border-color 0.2s ease;
}

.raid-ai-input::placeholder {
    color: #6a6a85;
}

.raid-ai-input:focus {
    border-color: #6c5ce7;
}

.raid-ai-send-btn {
    background: #6c5ce7;
    color: #ffffff;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.raid-ai-send-btn:hover {
    background: #5a4bd6;
}

.raid-ai-send-btn:active {
    transform: scale(0.97);
}

.raid-ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   4. APP DRAWER
   -------------------------------------------------------------------------- */

.raid-app-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: #12122b;
    border-left: 1px solid #2a2a45;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.raid-app-drawer.open {
    transform: translateX(0);
}

.raid-app-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a45;
    font-weight: 700;
    font-size: 18px;
}

.raid-app-drawer-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #c8c8e0;
    font-size: 18px;
}

.raid-app-drawer-close:hover {
    background: #1a1a35;
    color: #e6e6f0;
}

/* App grid */
.raid-app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 24px;
}

.raid-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    text-align: center;
}

.raid-app-item:hover {
    background: #1a1a35;
    transform: translateY(-2px);
}

.raid-app-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #1a1a35;
    font-size: 24px;
}

.raid-app-name {
    font-size: 12px;
    color: #c8c8e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Drawer overlay */
.raid-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.raid-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   5. HOME PAGE
   -------------------------------------------------------------------------- */

.raid-browser-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 24px;
    text-align: center;
}

.raid-hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.raid-hero-subtitle {
    font-size: 1.1rem;
    color: #c8c8e0;
    margin-bottom: 40px;
}

/* Quick search */
.raid-quick-search {
    width: 100%;
    max-width: 600px;
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.raid-quick-search-input {
    flex: 1;
    background: #12122b;
    border: 1px solid #2a2a45;
    border-radius: 12px;
    padding: 16px;
    color: #e6e6f0;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.raid-quick-search-input::placeholder {
    color: #6a6a85;
}

.raid-quick-search-input:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.raid-quick-search-btn {
    background: #6c5ce7;
    color: #ffffff;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.raid-quick-search-btn:hover {
    background: #5a4bd6;
}

/* Quick links */
.raid-quick-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 48px;
    width: 100%;
    max-width: 720px;
}

.raid-ql-card {
    background: #12122b;
    border: 1px solid #2a2a45;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.raid-ql-card:hover {
    background: #1a1a35;
    border-color: #6c5ce7;
    transform: translateY(-4px);
}

.raid-ql-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.raid-ql-label {
    font-size: 14px;
    font-weight: 500;
    color: #e6e6f0;
}

/* --------------------------------------------------------------------------
   6. PAGE CONTENT
   -------------------------------------------------------------------------- */

.raid-page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.raid-page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #ffffff;
}

.raid-page-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 13px;
    color: #6a6a85;
}

.raid-page-body {
    font-size: 16px;
}

.raid-page-body p {
    line-height: 1.8;
    color: #c8c8e0;
    margin-bottom: 1.2em;
}

.raid-page-body a {
    color: #6c5ce7;
    text-decoration: none;
}

.raid-page-body a:hover {
    color: #a29bfe;
    text-decoration: underline;
}

.raid-page-body h2 {
    font-size: 1.6rem;
    margin: 1.5em 0 0.6em;
    color: #ffffff;
}

.raid-page-body h3 {
    font-size: 1.3rem;
    margin: 1.4em 0 0.5em;
    color: #e6e6f0;
}

.raid-page-body ul,
.raid-page-body ol {
    color: #c8c8e0;
    line-height: 1.8;
    margin-bottom: 1.2em;
    padding-left: 1.5em;
}

.raid-page-body li {
    margin-bottom: 0.4em;
}

.raid-page-body blockquote {
    border-left: 4px solid #6c5ce7;
    background: #12122b;
    padding: 16px 24px;
    margin: 1.5em 0;
    border-radius: 0 8px 8px 0;
    color: #c8c8e0;
    font-style: italic;
}

.raid-page-body img {
    border-radius: 12px;
    margin: 1.5em 0;
}

.raid-page-body code {
    background: #12122b;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 14px;
    color: #a29bfe;
}

.raid-page-body pre {
    background: #12122b;
    border: 1px solid #2a2a45;
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.raid-page-body pre code {
    background: transparent;
    padding: 0;
    color: #e6e6f0;
}

.raid-page-body hr {
    border: none;
    border-top: 1px solid #2a2a45;
    margin: 2em 0;
}

.raid-page-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.raid-page-body th,
.raid-page-body td {
    border: 1px solid #2a2a45;
    padding: 10px 14px;
    text-align: left;
}

.raid-page-body th {
    background: #12122b;
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   ADDITIONAL UTILITY & STATE STYLES
   -------------------------------------------------------------------------- */

.raid-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #2a2a45;
    border-top-color: #6c5ce7;
    border-radius: 50%;
    animation: raid-spin 0.8s linear infinite;
}

@keyframes raid-spin {
    to {
        transform: rotate(360deg);
    }
}

.raid-progress-bar {
    position: fixed;
    top: 48px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    z-index: 950;
    transition: width 0.3s ease;
}

.raid-fade-in {
    animation: raid-fade-in 0.3s ease;
}

@keyframes raid-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.raid-hidden {
    display: none !important;
}

.raid-tooltip {
    position: relative;
}

.raid-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    background: #1a1a35;
    color: #e6e6f0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1100;
}

.raid-tooltip:hover::after {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   7. RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .raid-ai-panel {
        width: 300px;
    }

    .raid-quick-links {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Hide AI panel */
    .raid-ai-panel {
        display: none;
    }

    /* App drawer full width */
    .raid-app-drawer {
        width: 100%;
    }

    /* App grid 2 columns */
    .raid-app-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* URL bar wider on mobile */
    .raid-url-bar {
        width: 100%;
    }

    /* Hide some chrome actions */
    .raid-chrome-actions {
        gap: 2px;
    }

    /* Hero title smaller */
    .raid-hero-title {
        font-size: 2.5rem;
    }

    /* Quick links 2 columns */
    .raid-quick-links {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Quick search stack */
    .raid-quick-search {
        flex-direction: column;
    }

    .raid-quick-search-btn {
        width: 100%;
    }

    /* Page content padding */
    .raid-page-content {
        padding: 24px 16px;
    }

    .raid-page-title {
        font-size: 1.5rem;
    }

    /* Tabs hide title on small screens */
    .raid-tab {
        max-width: 120px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .raid-chrome-bar {
        padding: 0 8px;
        gap: 4px;
    }

    .raid-nav-buttons {
        gap: 2px;
    }

    .raid-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .raid-hero-title {
        font-size: 2rem;
    }

    .raid-app-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .raid-ql-card {
        padding: 16px;
    }

    .raid-tab-title {
        display: none;
    }

    .raid-tab {
        max-width: 80px;
    }
}

/* --------------------------------------------------------------------------
   PRINT STYLES
   -------------------------------------------------------------------------- */

@media print {
    .raid-chrome-bar,
    .raid-ai-panel,
    .raid-app-drawer,
    .raid-drawer-overlay {
        display: none !important;
    }

    .raid-main {
        margin-top: 0;
        height: auto;
    }

    body {
        background: #ffffff;
        color: #000000;
        overflow: visible;
    }

    .raid-page-body p,
    .raid-page-body li {
        color: #000000;
    }
}

/* --------------------------------------------------------------------------
   END OF RAID BROWSER STYLESHEET
   -------------------------------------------------------------------------- */
