/* Custom CSS for Digital Signature Form */

/* Body and general styling */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Card styling */
.card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

/* Form styling */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* Signature canvas styling */
.signature-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.signature-canvas {
    width: 100%;
    height: 200px;
    background: white;
    border: 3px solid #007bff;
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
}

.signature-instructions {
    border-left: 4px solid #007bff;
}

.signature-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Button styling */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
}

.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    transform: translateY(-1px);
}

.btn-outline-info {
    border: 2px solid #17a2b8;
    color: #17a2b8;
}

.btn-outline-info:hover {
    background: #17a2b8;
    transform: translateY(-1px);
}

/* Section headers */
.text-primary {
    color: #007bff !important;
}

.border-bottom {
    border-bottom: 2px solid #007bff !important;
}

/* Modal styling */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-radius: 15px 15px 0 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 10px;
    }
    
    .card {
        margin-top: 10px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .signature-canvas {
        height: 150px;
    }
    
    .signature-controls {
        justify-content: center;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .signature-controls .btn {
        width: auto;
        flex: 1;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 15px;
    }
    
    .btn {
        padding: 15px 25px;
        font-size: 16px;
    }
    
    .signature-canvas {
        height: 180px;
        border-width: 4px;
    }
}

/* Loading spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Success modal */
.modal-header.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

/* Error styling */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}

/* Animation for form validation */
.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Signature pad improvements */
.signature-container:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.signature-canvas:hover {
    border-color: #0056b3;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn, .modal {
        display: none;
    }
}
