/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Typography */
body {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    height: 100vh;
    overflow-x: hidden;
    display: flex;
    transition: all 0.3s ease;
}

/* Theme Variables */
body.light {
    --bg: #ffffff;
    --text: #000000;
    --border: #d0d0d0;
    --hover: #f8f8f8;
    --tooltip-bg: #1a1a1a;
    --tooltip-text: #ffffff;
    --highlight: #0066ff;
    --dim: #666666;
}

body.dark {
    --bg: #000000;
    --text: #ffffff;
    --border: #333333;
    --hover: #111111;
    --tooltip-bg: #f0f0f0;
    --tooltip-text: #000000;
    --highlight: #4d94ff;
    --dim: #999999;
}

body {
    background-color: var(--bg);
    color: var(--text);
}

/* Layout Components */
.side-text {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
    position: relative;
}

.vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dim);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 1000;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--text);
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--text);
    color: var(--bg);
}

/* Section Layout */
.software-section {
    height: 30vh;
    padding: 40px 30px 20px 30px;
    display: flex;
    flex-direction: column;
}

.middle-section {
    height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 30px;
    position: relative;
}

.hardware-section {
    height: 30vh;
    padding: 20px 30px 40px 30px;
    display: flex;
    flex-direction: column;
}

/* Section Headers */
.section-header {
    margin-bottom: 15px;
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dim);
}

/* Product Grids */
.product-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    flex: 1;
    margin-bottom: 0;
}

/* Software Items */
.software-item {
    border: 1px solid var(--border);
    padding: 12px 8px;
    text-align: center;
    font-size: 11px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.software-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--highlight);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.software-item:hover::before {
    transform: translateX(0);
}

.software-item:hover {
    background-color: var(--hover);
}

/* Hardware Items */
.hardware-item {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--hover);
}

.hardware-item:hover {
    transform: scale(1.05);
    border-color: var(--highlight);
}

.hardware-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.hardware-item:hover .hardware-img {
    filter: grayscale(0%);
}

/* Middle Section Content */
.product-heading {
    font-size: 48px;
    font-weight: 300;
    letter-spacing: 8px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.divider {
    font-weight: 100;
    color: var(--dim);
}

.product-descriptions {
    width: 100%;
    max-width: 800px;
    text-align: center;
    position: relative;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.company-description {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
}

.product-specific-description {
    height: 60px;
    position: relative;
}

.description-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--dim);
    position: absolute;
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    top: 0;
}

.description-text.active {
    opacity: 1;
}

/* Highlighted Terms and Tooltips */
.highlight-term {
    color: var(--highlight);
    cursor: help;
    position: relative;
    border-bottom: 1px dotted var(--highlight);
    transition: all 0.2s ease;
}

.highlight-term:hover {
    color: var(--text);
    border-bottom-style: solid;
}

.highlight-term::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.highlight-term:hover::after {
    opacity: 1;
}

/* Hover Indicators */
.hover-indicator {
    position: absolute;
    bottom: 20px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dim);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.software-hover-indicator {
    left: 30px;
}

.hardware-hover-indicator {
    right: 30px;
}

.hover-indicator.active {
    opacity: 1;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    font-size: 12px;
    justify-content: center;
    padding: 12px 0px 16px 0px;
}

.page-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.page-btn:hover {
    background: var(--hover);
}

.page-btn.active {
    background: var(--text);
    color: var(--bg);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .product-heading {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .side-text {
        display: none;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-heading {
        font-size: 24px;
        letter-spacing: 4px;
    }
}