body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
}

.header {
    background: hsl(207, 60%, 65%);
    color: white;
    padding: 15px 20px;
    text-align: center;
    flex-shrink: 0;
}

.header h1 {
    margin: 0 0 5px 0;
    font-size: 22px;
}

.header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.status {
    padding: 10px 20px;
    margin: 0;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.status.info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #2196f3;
}

.status.success {
    background: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.status.error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.debug-info {
    background: #f8f9fa;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    font-size: 11px;
    color: #666;
    font-family: Monaco, 'Courier New', monospace;
    white-space: pre-line;
    max-height: 120px;
    overflow-y: auto;
    flex-shrink: 0;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 20px;
    background: #fafafa;
    border-bottom: 2px solid #eee;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border-radius: 6px;
    background: white;
    border: 1px solid #ddd;
}

.control-group button, .control-group select {
    background: hsl(207, 60%, 65%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    white-space: nowrap;
}

.control-group button:hover:not(:disabled) {
    background: hsl(207, 60%, 55%);
    transform: translateY(-1px);
}

.control-group button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.markup-tools .markup-btn.active {
    background: #ff6b35;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.clear-btn {
    background: #dc3545 !important;
}

.clear-btn:hover {
    background: #c82333 !important;
}

/* View mode button styling */
#single-mode-btn.active, #continuous-mode-btn.active {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

#single-mode-btn, #continuous-mode-btn {
    background: #f8f9fa !important;
    color: #333 !important;
}

#single-mode-btn:hover, #continuous-mode-btn:hover {
    background: #e9ecef !important;
}

.control-group span {
    font-weight: 500;
    color: #333;
    font-size: 12px;
    white-space: nowrap;
    padding: 0 5px;
}

.viewer-container {
    position: relative;
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background: #f8f9fa;
}

.pdf-container {
    display: block;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: white;
    position: relative;
    z-index: 1;
}

.markup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
    cursor: crosshair;
}

.markup-overlay.active {
    pointer-events: all;
}

.markup-panel {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 250px;
    background: white;
    border: 2px solid hsl(207, 60%, 65%);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
}

.markup-panel.show {
    display: block;
}

.panel-header {
    background: hsl(207, 60%, 65%);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 14px;
}

.panel-header button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-content {
    padding: 15px;
}

.panel-content > div {
    margin-bottom: 15px;
}

.panel-content label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 12px;
}

.panel-content input[type="color"] {
    width: 100%;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.panel-content input[type="range"] {
    width: calc(100% - 50px);
    margin-right: 10px;
}

.panel-content span {
    font-size: 12px;
    color: #666;
    min-width: 40px;
    display: inline-block;
}

.version-controls select {
    min-width: 120px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .control-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .markup-panel {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        transform: none;
        width: calc(100% - 40px);
        max-width: 300px;
    }
    
    .viewer-container {
        padding: 10px;
    }
}

/* Hide scrollbars but keep functionality */
.viewer-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.viewer-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.viewer-container::-webkit-scrollbar-thumb {
    background: hsl(207, 60%, 65%);
    border-radius: 4px;
}

.viewer-container::-webkit-scrollbar-thumb:hover {
    background: hsl(207, 60%, 55%);
}