body {
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

.main-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin: 20px;
}

.header {
    background: linear-gradient(135deg, #1e1e1e 0%, #1e1e1eb3 100%);
    color: white;
    padding: 30px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.upload-area {
    border: 3px dashed #1e1e1e;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background: #FFFDEE;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #1e1e1e;
    background: #fffdeea3;
}

.upload-area.dragover {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.control-panel {
    background: #fffdee;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.preview-area {
    background: white;
    border-radius: 15px;
    padding: 0;
    /* Remove padding when PDF is loaded */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    height: calc(100vh - 200px);
    min-height: 800px;
    display: flex;
    flex-direction: column;
}

.preview-area.no-pdf {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#previewContent {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

#previewContent iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 15px !important;
    box-shadow: none !important;
    flex: 1;
}

#previewContent .text-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
}

.preview-area.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

/* PDF Preview iframe styling */
.preview-area iframe {
    width: 100% !important;
    height: calc(100% - 20px) !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 10px !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.preview-area.fullscreen iframe {
    height: 100vh !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Fullscreen controls */
.fullscreen-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 8px;
    backdrop-filter: blur(10px);
}

.fullscreen-controls button {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 5px;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.fullscreen-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.btn-custom {
    background: linear-gradient(135deg, #de9406 0%, #de94069c 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    color: #1e1e1e;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    color: white;
}

.form-control,
.form-control-file {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.nav-tabs .nav-link {
    border-radius: 10px 10px 0 0;
    border: none;
    background: #e9ecef;
    color: #495057;
    margin-right: 5px;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #1e1e1e 0%, #1e1e1eb3 100%);
    color: white !important;
}

.tab-content {
    background: white;
    border-radius: 0 15px 15px 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.file-info {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
}

.navigation-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.position-btn {
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.position-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.position-btn.active {
    border-color: #1e1e1e;
    background: #1e1e1e;
    color: white;
}

.transparency-slider {
    background: linear-gradient(to right, #667eea, #764ba2);
    height: 8px;
    border-radius: 5px;
    outline: none;
}

/* Loading spinner styling */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Zoom controls */
.zoom-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.zoom-controls .btn {
    margin: 2px;
    padding: 8px 12px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .preview-area {
        height: calc(100vh - 250px);
        min-height: 600px;
    }
}

@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        border-radius: 15px;
    }

    .preview-area {
        height: calc(100vh - 300px);
        min-height: 500px;
        border-radius: 10px;
    }

    #previewContent iframe {
        border-radius: 10px !important;
    }

    .control-panel {
        margin-bottom: 20px;
        max-height: none;
        overflow-y: visible;
    }

    .header {
        padding: 20px;
    }

    .zoom-controls {
        top: 5px;
        left: 5px;
        padding: 5px;
    }

    .fullscreen-controls {
        top: 10px;
        right: 10px;
        padding: 5px;
    }

    .fullscreen-controls button {
        padding: 8px 10px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .preview-area {
        height: calc(100vh - 350px);
        min-height: 400px;
    }

    .zoom-controls .btn {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* Custom scrollbar for better UX */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Hide scrollbars in fullscreen mode */
.preview-area.fullscreen {
    overflow: hidden;
}

/* Loading state for large preview */
.preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex-direction: column;
}

.preview-loading h5 {
    margin-top: 20px;
    color: #667eea;
}