body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border: none;
}

.upload-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #667eea;
    transition: all 0.3s ease;
}

.upload-section:hover {
    border-color: #764ba2;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.upload-section h5 {
    color: #667eea;
    font-weight: 600;
}

.document-container-wrapper {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    max-height: 800px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.document-container-wrapper::-webkit-scrollbar {
    width: 8px;
}

.document-container-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.document-container-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.document-container-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.document-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-height: 600px;
}

.document-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.document-image {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}

.signature-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: crosshair;
    touch-action: none;
    pointer-events: auto;
}

.controls-panel {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
}

.form-select, .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-select:focus, .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-range::-webkit-slider-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.form-range::-moz-range-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.signed-doc-card {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.signed-doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.signed-doc-card .card-body {
    padding: 1.5rem;
}

.signed-doc-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.signed-doc-card .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.signed-doc-card .btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.signed-doc-card .btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

.signed-doc-card .btn-outline-danger:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: transparent;
}

.bg-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

#previewModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#previewModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#previewModal .modal-body {
    background: #f8f9fa;
    padding: 2rem;
}

#previewImage {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .document-container {
        min-height: 400px;
    }
    
    .document-placeholder {
        min-height: 400px;
    }
    
    .controls-panel .col-md-3,
    .controls-panel .col-md-6 {
        margin-bottom: 1rem;
    }

    .signed-doc-card {
        margin-bottom: 1rem;
    }
}
