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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.controls button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.controls button:hover:not(:disabled) {
    background-color: #2980b9;
}

.controls button:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}

#pageInfo, #zoomLevel {
    background-color: #34495e;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.drop-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed #bdc3c7;
    border-radius: 8px;
    margin: 2rem;
    background-color: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #3498db;
    background-color: #ecf0f1;
}

.drop-content {
    text-align: center;
    padding: 2rem;
}

.drop-content svg {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.drop-content h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.drop-content p {
    color: #7f8c8d;
    font-size: 1rem;
}

.main-content {
    flex: 1;
    display: flex;
    gap: 1rem;
}

.pdf-viewer {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow: auto;
    background-color: #ecf0f1;
    position: relative;
}

#pdfCanvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background-color: white;
    border-radius: 4px;
}

.loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .controls {
        font-size: 0.8rem;
    }
    
    .controls button,
    #pageInfo,
    #zoomLevel {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    .drop-content h2 {
        font-size: 1.2rem;
    }
    
    .drop-content p {
        font-size: 0.9rem;
    }
}

/* Drag and drop visual feedback */
.drop-zone.drag-over {
    border-color: #27ae60;
    background-color: #d5f4e6;
}

.drop-zone.drag-over .drop-content svg {
    color: #27ae60;
}

.drop-zone.drag-over .drop-content h2 {
    color: #27ae60;
}

/* Cursor Position Tab */
.cursor-position {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(44, 62, 80, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* Metadata Panel */
.metadata-panel {
    width: 300px;
    background-color: white;
    border-left: 1px solid #bdc3c7;
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
}

.metadata-panel h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.metadata-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.metadata-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.metadata-item label {
    font-weight: 600;
    color: #34495e;
    font-size: 0.9rem;
}

.metadata-item span {
    color: #7f8c8d;
    font-size: 0.85rem;
    word-wrap: break-word;
    background-color: #f8f9fa;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.no-custom-data {
    text-align: center;
    padding: 2rem 1rem;
    color: #7f8c8d;
    font-style: italic;
}

.no-custom-data p {
    margin: 0;
    font-size: 0.9rem;
}

/* Custom Properties Table */
.custom-properties-table {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 2fr;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
}

.header-name,
.header-value {
    padding: 0.75rem 0.5rem;
    border-right: 1px solid #e9ecef;
}

.header-value {
    border-right: none;
}

.table-body {
    max-height: 400px;
    overflow-y: auto;
}

.property-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s;
}

.property-row:hover {
    background-color: #f8f9fa;
}

.property-row:last-child {
    border-bottom: none;
}

.property-name,
.property-value {
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
    border-right: 1px solid #f1f3f4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.property-name {
    background-color: #fdfdfe;
    font-weight: 500;
    color: #495057;
}

.property-value {
    background-color: white;
    color: #6c757d;
    border-right: none;
    font-family: 'Courier New', monospace;
}

.property-value.long-value {
    max-height: 60px;
    overflow-y: auto;
    font-size: 0.8rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .metadata-panel {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .metadata-panel {
        width: 100%;
        max-height: 200px;
        border-left: none;
        border-top: 1px solid #bdc3c7;
    }
    
    .cursor-position {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}
