/* ============================================
   ROCKETTEC Documentation Styles
   ============================================ */

:root {
    --primary-color: #0f172a;
    --secondary-color: #1e293b;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --text-color: #e2e8f0;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --background-dark: #0f172a;
    --background-darker: #020617;
    --border-color: rgba(59, 130, 246, 0.2);
    --white: #ffffff;
    --code-bg: #1e293b;
    --sidebar-width: 280px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background-dark);
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Layout
   ============================================ */

.docs-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Header
   ============================================ */

.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--white);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--white);
}

.header-logo img {
    height: 36px;
}

.header-logo span {
    font-size: 1.125rem;
    font-weight: 700;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 8px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    background-color: rgba(59, 130, 246, 0.1);
}

.back-button:hover {
    color: var(--white);
    background-color: rgba(59, 130, 246, 0.2);
}

.header-search {
    flex: 1;
    max-width: 500px;
    min-width: 0;
}

.header-search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    width: 100%;
    transition: all 0.2s;
}

.header-search-form:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.header-search-form svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.header-search-form input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.875rem;
    min-width: 0;
}

.header-search-form input::placeholder {
    color: var(--text-muted);
}

.clear-search {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-search:hover {
    color: var(--text-color);
    background-color: rgba(59, 130, 246, 0.1);
}

.search-highlight {
    background-color: rgba(250, 204, 21, 0.5);
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    letter-spacing: inherit;
    word-spacing: inherit;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.header-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

.header-nav a:hover {
    color: var(--accent-color);
}

/* ============================================
   Language Selector
   ============================================ */

.language-selector {
    position: relative;
}

.language-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s;
}

.language-button:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.flag-icon {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.language-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
}

.language-option:hover {
    background: rgba(59, 130, 246, 0.1);
}

.language-option.active {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-color);
}

.language-option .auto-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

/* ============================================
   Sidebar Overlay
   ============================================ */

.sidebar-overlay {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 899;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Sidebar
   ============================================ */

.docs-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 64px);
    background-color: var(--background-darker);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem 0;
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.docs-sidebar.open {
    transform: translateX(0);
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: var(--white);
    background-color: rgba(59, 130, 246, 0.1);
}

.sidebar-link.active {
    color: var(--accent-color);
    background-color: rgba(59, 130, 246, 0.1);
    border-left-color: var(--accent-color);
}

.sidebar-link svg {
    vertical-align: middle;
    margin-right: 0.5rem;
}

.sidebar-coming-soon {
    opacity: 0.5;
    cursor: default;
}

.sidebar-coming-soon:hover {
    color: var(--text-light);
    background-color: transparent;
}

/* ============================================
   Main Content
   ============================================ */

.docs-main {
    margin-left: 0;
    margin-top: 64px;
    flex: 1;
    padding: 3rem 4rem;
    min-height: calc(100vh - 64px);
    width: 100%;
    transition: margin-left 0.3s ease;
}

.docs-content {
    width: 100%;
}

/* ============================================
   Typography
   ============================================ */

.docs-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--white);
    letter-spacing: -0.025em;
}

.docs-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--white);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.docs-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--white);
}

.docs-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.docs-content p {
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.8;
}

.docs-content ul, .docs-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.docs-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.docs-content a:hover {
    text-decoration: underline;
}

.docs-content strong {
    color: var(--white);
    font-weight: 600;
}

/* ============================================
   Code Blocks
   ============================================ */

.docs-content code {
    font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
    font-size: 0.9em;
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: #93c5fd;
}

.docs-content pre {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.docs-content pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* ============================================
   Tables
   ============================================ */

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background-color: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.docs-content th, .docs-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.docs-content th {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--white);
    font-weight: 600;
}

.docs-content tr:last-child td {
    border-bottom: none;
}

/* ============================================
   Alerts/Notes
   ============================================ */

.docs-content blockquote {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--accent-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.docs-content blockquote p {
    margin: 0;
    color: var(--text-color);
}

/* ============================================
   Horizontal Rule
   ============================================ */

.docs-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 3rem 0;
}

/* ============================================
   Hero Section (for index)
   ============================================ */

.docs-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 50%, #3b82f6 100%);
    padding: 4rem 2rem;
    margin: -3rem -4rem 3rem -4rem;
    text-align: center;
    border-radius: 0 0 16px 16px;
}

.docs-hero h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.docs-hero p {
    font-size: 1.25rem;
    color: #93c5fd;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Feature Grid
   ============================================ */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background-color: rgba(30, 41, 59, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.feature-card h3 {
    margin-top: 0;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

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

@media (max-width: 1024px) {
    .docs-main {
        padding: 2rem;
    }
    .header-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-header {
        padding: 0 1rem;
    }
    .docs-main {
        padding: 1.5rem;
    }
    .docs-hero {
        margin: -1.5rem -1.5rem 2rem -1.5rem;
    }
    .header-search {
        display: none;
    }
    .header-logo span {
        display: none;
    }
    .back-button {
        display: none;
    }
}

/* Desktop: sidebar always visible */
@media (min-width: 769px) {
    .docs-sidebar {
        transform: translateX(0);
    }
    .docs-main {
        margin-left: var(--sidebar-width);
    }
    .menu-toggle {
        display: none;
    }
    .sidebar-overlay {
        display: none;
    }
}

/* ============================================
   Serial Lookup Page
   ============================================ */

.serial-page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background-dark);
}

.serial-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 4rem 2rem;
    margin-top: 64px;
}

.serial-content {
    max-width: 700px;
    width: 100%;
}

.serial-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #f1f5f9;
}

.serial-description {
    font-size: 1.125rem;
    color: var(--text-light);
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.serial-lookup-container {
    margin-top: 1rem;
}

.serial-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.serial-input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1.25rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    border: 2px solid #334155;
    border-radius: 12px;
    background: var(--secondary-color);
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.serial-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.serial-input::placeholder {
    text-transform: none;
    color: var(--text-muted);
    letter-spacing: normal;
}

.lookup-button {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lookup-button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.lookup-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.device-result {
    background: var(--secondary-color);
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

.device-result h2 {
    margin: 0 0 1.5rem 0;
    color: #f1f5f9;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.info-value {
    font-size: 1.25rem;
    color: #f1f5f9;
    font-weight: 500;
}

.info-value.serial-number {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.warranty-valid {
    color: #22c55e !important;
    font-weight: 600;
}

.warranty-expired {
    color: #ef4444 !important;
    font-weight: 600;
}

.serial-footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.serial-footer p {
    margin: 0;
}

@media (max-width: 640px) {
    .serial-input-group {
        flex-direction: column;
    }

    .lookup-button {
        width: 100%;
    }

    .serial-content h1 {
        font-size: 1.75rem;
    }

    .serial-main {
        padding: 2rem 1rem;
    }
}
