/* Advanced PDF Annotator Styles */

/* Main Container */
.pdf-annotator-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

/* Tools Panel */
.annotation-tools-panel {
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 0;
}

.annotation-tools-panel::-webkit-scrollbar {
    width: 6px;
}

.annotation-tools-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.annotation-tools-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.annotation-tools-panel::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Tool Categories */
.tool-category {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
}

.tool-category:last-child {
    border-bottom: none;
}

.category-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-title i {
    margin-right: 8px;
    color: #6c757d;
}

/* Tool Buttons */
.tool-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tool-btn {
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 6px 10px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 80px;
    text-align: center;
}

.tool-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tool-btn.active {
    border-color: #007bff;
    background-color: #007bff;
    color: white;
    font-weight: 600;
}

.tool-btn i {
    margin-right: 4px;
    font-size: 0.9rem;
}

/* Property Groups */
.tool-properties {
    background: #ffffff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.property-group {
    margin-bottom: 15px;
}

.property-group:last-child {
    margin-bottom: 0;
}

.property-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    display: block;
}

/* Color Picker */
.form-control-color {
    width: 100% !important;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.form-control-color:hover {
    border-color: #007bff;
}

/* Range Sliders */
.form-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-range::-webkit-slider-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Select Dropdowns */
.form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 8px 12px;
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
}

.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Annotation List */
.annotation-list {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    max-height: 200px;
    overflow-y: auto;
}

.annotation-items {
    padding: 10px;
}

.annotation-item {
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.annotation-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.annotation-item:last-child {
    margin-bottom: 0;
}

.annotation-item i {
    margin-right: 8px;
    color: #6c757d;
}

/* Action Buttons */
.action-buttons {
    margin-top: 20px;
}

.action-buttons .btn {
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 15px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-buttons .btn i {
    margin-right: 6px;
}

/* Toolbar */
.annotator-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 20px;
}

.file-controls .btn {
    border-radius: 6px;
    font-size: 0.85rem;
    padding: 6px 12px;
}

.view-controls .btn {
    border-radius: 6px;
    font-size: 0.85rem;
    padding: 6px 10px;
    margin-left: 5px;
}

.view-controls .badge {
    font-size: 0.8rem;
    padding: 4px 8px;
}

/* PDF Viewer Area */
.pdf-viewer-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.pdf-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-prompt {
    text-align: center;
    color: #6c757d;
    max-width: 400px;
    margin: 0 auto;
}

.upload-prompt i {
    color: #dee2e6;
    margin-bottom: 20px;
}

.upload-prompt h4 {
    color: #495057;
    margin-bottom: 10px;
}

.upload-prompt p {
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Canvas Elements */
.pdf-canvas,
.annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: white;
    transform-origin: top left;
}

.pdf-canvas {
    z-index: 1;
}

.annotation-canvas {
    z-index: 2;
    pointer-events: auto;
}

/* Status Bar */
.status-bar {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Drag and Drop */
.drag-over {
    background: #e3f2fd !important;
    border: 2px dashed #2196f3 !important;
}

/* Modals */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 20px 25px;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 20px 25px;
}

/* Signature Canvas */
#signatureCanvas {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: crosshair;
    background: white;
}

/* Stamp Options */
.stamp-option {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: white;
}

.stamp-option:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stamp-option.selected {
    border-color: #007bff;
    background: #f8f9ff;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .annotation-tools-panel {
        height: auto;
        max-height: 400px;
    }
    
    .pdf-annotator-container {
        height: auto;
        min-height: 600px;
    }
}

@media (max-width: 768px) {
    .tool-buttons {
        justify-content: center;
    }
    
    .tool-btn {
        min-width: 70px;
        font-size: 0.75rem;
        padding: 5px 8px;
    }
    
    .annotation-tools-panel {
        margin-bottom: 20px;
    }
    
    .pdf-annotator-container {
        height: auto;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Selection Highlight */
.selection-highlight {
    background: rgba(0, 123, 255, 0.1);
    border: 2px dashed #007bff;
    border-radius: 4px;
}

/* Tool Cursors */
.cursor-crosshair {
    cursor: crosshair !important;
}

.cursor-text {
    cursor: text !important;
}

.cursor-pointer {
    cursor: pointer !important;
}

.cursor-grab {
    cursor: grab !important;
}

.cursor-grabbing {
    cursor: grabbing !important;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Annotation Preview */
.annotation-preview {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    pointer-events: none;
}

/* Error States */
.error-state {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.error-state i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #e53e3e;
}

/* Success States */
.success-state {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #2f855a;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.success-state i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #38a169;
}

/* Info States */
.info-state {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2b6cb0;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.info-state i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #3182ce;
} 