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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5em;
    color: #00d4ff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.subtitle {
    color: #aaa;
    font-size: 1.1em;
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
}

.status-indicator.disconnected {
    background: #ff4444;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#statusText {
    font-size: 1.1em;
    font-weight: 500;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.stick-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.stick-section h2 {
    color: #00d4ff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
}

.stick-container {
    position: relative;
    width: 200px;
    margin: 0 auto 20px;
}

canvas {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.stick-values {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
}

.stick-values span {
    color: #00d4ff;
    font-weight: bold;
}

.drift-indicator {
    padding: 12px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.drift-indicator.warning {
    background: rgba(255, 165, 0, 0.1);
    border-color: rgba(255, 165, 0, 0.5);
    animation: warning-pulse 1s infinite;
}

@keyframes warning-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 165, 0, 0.6);
    }
}

.drift-status {
    font-weight: 500;
}

.buttons-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.buttons-section h2 {
    color: #00d4ff;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.button-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.button-item.active {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    transform: scale(1.05);
}

.button-visual {
    font-size: 1.8em;
    font-weight: bold;
    color: #00d4ff;
}

.button-item span {
    font-size: 0.9em;
    color: #ccc;
}

.triggers-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.triggers-section h2 {
    color: #00d4ff;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.trigger-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.trigger-item h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    text-align: center;
}

.trigger-bar-container {
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.trigger-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff 0%, #00ff88 100%);
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

.trigger-value {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
}

.trigger-value span {
    color: #00d4ff;
    font-weight: bold;
}

.diagnostics-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.diagnostics-panel h2 {
    color: #00d4ff;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.diagnostics-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.diagnostic-item {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.diagnostic-item strong {
    color: #00d4ff;
}

.diagnostic-item span {
    color: #fff;
    margin-left: 8px;
}

.issues-log {
    margin-top: 20px;
}

.issues-log h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.log-content {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

.log-entry {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 4px solid;
}

.log-info {
    background: rgba(0, 212, 255, 0.1);
    border-left-color: #00d4ff;
}

.log-warning {
    background: rgba(255, 165, 0, 0.1);
    border-left-color: #ffa500;
}

.log-error {
    background: rgba(255, 68, 68, 0.1);
    border-left-color: #ff4444;
}

.log-time {
    color: #888;
    margin-right: 8px;
}

.reset-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
}

.reset-btn:active {
    transform: translateY(0);
}

footer {
    text-align: center;
    color: #888;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

footer p {
    margin-bottom: 10px;
}

.note {
    font-size: 0.9em;
    font-style: italic;
}

/* Scrollbar styling */
.log-content::-webkit-scrollbar {
    width: 8px;
}

.log-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.5);
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.7);
}

/* Ad Containers */
.ad-container {
    margin: 30px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    text-align: center;
}

.ad-label {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-slot {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-horizontal .ad-slot {
    min-height: 90px;
}

.ad-sidebar .ad-slot {
    min-height: 250px;
}

.ad-placeholder {
    color: #444;
    font-size: 0.9em;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Fix Recommendations Section */
.fix-recommendations {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.fix-recommendations h2 {
    color: #00d4ff;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.recommendations-content {
    min-height: 100px;
}

.no-issues-message {
    text-align: center;
    color: #888;
    padding: 30px;
    font-style: italic;
}

.recommendation-card {
    background: rgba(255, 165, 0, 0.1);
    border: 2px solid rgba(255, 165, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.recommendation-card.severity-high {
    border-color: rgba(255, 68, 68, 0.5);
    background: rgba(255, 68, 68, 0.1);
}

.recommendation-card h3 {
    color: #ffa500;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.recommendation-card.severity-high h3 {
    color: #ff6b6b;
}

.rec-description {
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.6;
}

.solutions-list h4 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.solution-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.solution-item:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateX(5px);
}

.solution-header {
    margin-bottom: 8px;
}

.solution-header strong {
    color: #00d4ff;
    font-size: 1.1em;
}

.solution-item p {
    color: #aaa;
    margin-bottom: 12px;
    line-height: 1.5;
}

.solution-link {
    display: inline-block;
    color: #00ff88;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.solution-link:hover {
    color: #00d4ff;
    transform: translateX(3px);
}

/* Accessories Section */
.accessories-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.accessories-section h2 {
    color: #00d4ff;
    margin-bottom: 25px;
    font-size: 1.4em;
}

.accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.accessory-item {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.accessory-item:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2);
}

.accessory-image-container {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.1);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.accessory-item:hover .product-image {
    transform: scale(1.05);
}

.accessory-image-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
}

.accessory-item h3 {
    color: #00d4ff;
    margin-bottom: 12px;
    font-size: 1.1em;
}

.accessory-item p {
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.product-link,
a.product-link,
.accessory-item .product-link {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 10px 20px !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%) !important;
    color: #1a1a2e !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 40px;
    max-height: none !important;
    line-height: 1.4;
    pointer-events: auto !important;
    position: relative !important;
    overflow: visible !important;
}

/* Force visibility even when href is # */
.product-link[href="#"] {
    opacity: 0.5 !important;
    cursor: not-allowed;
}

.product-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .trigger-container {
        grid-template-columns: 1fr;
    }

    .accessories-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .button-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .diagnostics-content {
        grid-template-columns: 1fr;
    }

    .accessories-grid {
        grid-template-columns: 1fr;
    }

    .ad-sidebar {
        display: none;
    }
}
