@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* ========================================
   GLOBAL BREAKPOINTS
   ======================================== */
:root {
    --breakpoint-mobile: 480px;
    --breakpoint-tablet: 768px;
    --breakpoint-desktop: 1024px;
    --breakpoint-wide: 1280px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    background-color: #111;
}

a {
    color: #74b9ae;
    text-decoration: none;
    transition: all 100ms cubic-bezier(0.4, 0, 0.2, 1);
}
a:hover {
    color: #5a9a90;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.config-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #111;
}

.wiki-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 1.5rem;
    background-color: rgba(34, 34, 34, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 300;
}
@media (max-width: 480px) {
    .wiki-header {
        height: 56px;
        padding: 0 0.75rem;
    }
}
.wiki-header__left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex-shrink: 1;
}
@media (max-width: 480px) {
    .wiki-header__left {
        gap: 0.5rem;
    }
}
.wiki-header__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
@media (max-width: 480px) {
    .wiki-header__right {
        gap: 0.25rem;
    }
}
.wiki-header__title {
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 480px) {
    .wiki-header__title {
        font-size: 0.875rem;
    }
}

.wiki-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}
.wiki-logo__image {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.wiki-logo__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
@media (max-width: 480px) {
    .header-links {
        gap: 0.25rem;
    }
}
.header-links__item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #b8dcd6;
    background: transparent;
    border: none;
    gap: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
}
@media (max-width: 480px) {
    .header-links__item {
        height: 32px;
        padding: 0 0.5rem;
        font-size: 0;
    }
    .header-links__item .material-icons {
        font-size: 20px;
    }
}
.header-links__item .material-icons {
    font-family: 'Material Icons';
    font-size: 18px;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
}
.header-links__item:hover {
    color: #fff;
    background: #2a2a2a;
}
.header-links__item--logout {
    border: 1px solid #444;
}
.header-links__item--logout:hover {
    border-color: #ff453a;
    color: #ff453a;
    background: transparent;
}

.config-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 0;
}
@media (max-width: 1024px) {
    .config-main {
        grid-template-columns: 1fr;
    }
}

.config-panel {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 64px);
}
@media (max-width: 768px) {
    .config-panel {
        padding: 1rem;
    }
}
@media (max-width: 480px) {
    .config-panel {
        padding-bottom: 80px;
    }
}

.log-panel {
    background: #222;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 64px);
}
@media (max-width: 1024px) {
    .log-panel {
        border-left: none;
        border-top: 1px solid #333;
        max-height: 350px;
    }
}
@media (max-width: 480px) {
    .log-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 60px;
        border-top: 2px solid #74b9ae;
        border-radius: 12px 12px 0 0;
        z-index: 200;
        transition: max-height 300ms cubic-bezier(0.4, 0, 0.2, 1);
    }
    .log-panel.log-panel--expanded {
        max-height: 50vh;
    }
    .log-panel .log-header {
        cursor: pointer;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .log-panel .log-header::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #555;
        border-radius: 2px;
        flex-basis: 100%;
        margin: 0 auto;
    }
    .log-panel .log-header .log-title {
        font-size: 0.875rem;
    }
    .log-panel .log-header .log-clear-btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

.log-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.log-title {
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
}

.log-clear-btn {
    padding: 0.25rem 0.75rem;
    background: transparent;
    border: 1px solid #444;
    border-radius: 4px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 100ms cubic-bezier(0.4, 0, 0.2, 1);
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
}
.log-clear-btn:hover {
    border-color: #b8dcd6;
    color: #b8dcd6;
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.log-entry {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #333;
    border-radius: 6px;
    border-left: 3px solid #74b9ae;
}
.log-entry--error {
    border-left-color: #ff453a;
}
.log-entry--success {
    border-left-color: #30d158;
}
.log-entry__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.log-entry__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}
.log-entry__time {
    font-size: 0.75rem;
    color: #888;
    font-family:
        'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
}
.log-entry__body {
    font-family:
        'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.75rem;
    color: #b8dcd6;
    background: #1a1a1a;
    padding: 0.75rem;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.config-section {
    margin-bottom: 2rem;
}
.config-section__title {
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #74b9ae;
    display: inline-block;
}
.config-section__description {
    font-size: 0.875rem;
    color: #b8dcd6;
    margin-bottom: 1rem;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.param-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-input,
.param-select {
    padding: 0.5rem 0.75rem;
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 0.875rem;
    font-family:
        'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.param-input:hover,
.param-select:hover {
    border-color: rgb(93.5, 93.5, 93.5);
}
.param-input:focus,
.param-select:focus {
    outline: none;
    border-color: #74b9ae;
    box-shadow: 0 0 0 3px rgba(116, 185, 174, 0.3);
}

.param-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.endpoint-card {
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 480px) {
    .endpoint-card {
        padding: 1rem;
        font-size: 80%;
    }
}
.endpoint-card:hover {
    border-color: #444;
}
.endpoint-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
@media (max-width: 480px) {
    .endpoint-card__header {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
}
.endpoint-card__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
@media (max-width: 480px) {
    .endpoint-card__title {
        gap: 0.5rem;
    }
}
.endpoint-card__name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}
@media (max-width: 480px) {
    .endpoint-card__name {
        font-size: 0.8rem;
    }
}
.endpoint-card__method {
    font-family:
        'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}
@media (max-width: 480px) {
    .endpoint-card__method {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
}
.endpoint-card__method--get {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
}
.endpoint-card__method--post {
    background: rgba(116, 185, 174, 0.15);
    color: #74b9ae;
}
.endpoint-card__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.endpoint-card__body {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
@media (max-width: 600px) {
    .endpoint-card__body {
        flex-direction: column;
    }
}
.endpoint-card__input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: #333;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 0.875rem;
    font-family:
        'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.endpoint-card__input::placeholder {
    color: #888;
}
.endpoint-card__input:hover:not(:disabled) {
    border-color: rgb(93.5, 93.5, 93.5);
}
.endpoint-card__input:focus {
    outline: none;
    border-color: #74b9ae;
    box-shadow: 0 0 0 3px rgba(116, 185, 174, 0.3);
}
.endpoint-card__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.endpoint-card__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.toggle-label {
    font-size: 0.75rem;
    color: #888;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #333;
    border: 1px solid #444;
    border-radius: 9999px;
    transition: all 100ms cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-slider:before {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: #888;
    border-radius: 50%;
    transition: all 100ms cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(116, 185, 174, 0.3);
    border-color: #74b9ae;
}
.toggle-switch input:checked + .toggle-slider:before {
    background: #74b9ae;
    transform: translateX(20px);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
}
.btn .material-icons {
    font-family: 'Material Icons';
    font-size: 18px;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
}
.btn--primary {
    background: #74b9ae;
    color: #111;
}
.btn--primary:hover:not(:disabled) {
    background: #5a9a90;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.btn--secondary {
    background: #333;
    color: #b8dcd6;
    border: 1px solid #444;
}
.btn--secondary:hover:not(:disabled) {
    background: #2a2a2a;
    color: #fff;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fallback-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #888;
}
@media (max-width: 480px) {
    .fallback-note {
        display: none;
    }
}
.fallback-note code {
    font-family:
        'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: #1a1a1a;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    color: #74b9ae;
    font-size: 0.7rem;
}
