/* Custom styles for Forest Valuation System */

:root {
    --success-color: #198754;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --forest-green: #2d5016;
    --forest-light: #4a7c59;
}

/* Body and Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--forest-light) 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/images/cadastral-hero.png') center/cover no-repeat;
    opacity: 0.15;
    z-index: 0;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="tree" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23tree)"/></svg>') repeat;
    opacity: 0.2;
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    padding: 1.5rem;
}

/* Forms */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.15);
}

.btn {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 1rem 2rem;
}

/* Feature Icons */
.feature-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Footer */
footer {
    margin-top: auto;
}

footer .text-muted {
    color: #adb5bd !important;
}

footer h5, footer h6 {
    color: #ffffff !important;
}

footer p {
    color: #adb5bd !important;
}

footer a {
    color: #adb5bd !important;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff !important;
}

/* Admin Panel Specific */
.admin-panel .card {
    border-left: 4px solid var(--warning-color);
}

/* Formula Preview */
.formula-preview {
    font-family: 'Courier New', monospace;
    border-left: 4px solid var(--info-color);
}

/* Table Styling */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--forest-green);
}

.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

/* Alert Enhancements */
.alert {
    border-radius: 15px;
    border: none;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #0f5132;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
    color: #721c24;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        padding: 2rem 0;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .hero-section {
        background: white !important;
        color: black !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    
    .btn, .navbar, footer, .alert {
        display: none !important;
    }
    
    .text-white {
        color: black !important;
    }
    
    .bg-success, .bg-warning, .bg-info {
        background: white !important;
        color: black !important;
        border: 1px solid #ddd !important;
    }
}

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

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

/* Success State Animations */
.alert-success {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom Input Groups */
.input-group-text {
    background-color: var(--success-color);
    color: white;
    border: 2px solid var(--success-color);
    border-radius: 0 10px 10px 0;
}

.input-group .form-control {
    border-radius: 10px 0 0 10px;
    border-right: none;
}

.input-group .form-control:focus {
    border-color: var(--success-color);
    border-right: none;
}

/* Utility Classes */
.text-forest {
    color: var(--forest-green) !important;
}

.bg-forest {
    background-color: var(--forest-green) !important;
}

.border-forest {
    border-color: var(--forest-green) !important;
}

/* Custom Badge Styles */
.badge {
    border-radius: 8px;
    padding: 0.5em 0.75em;
}

/* Enhanced Form Validation */
.was-validated .form-control:valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.7-.7L4.3 5 6.6 2.7l.7.7-3 3z'/%3e%3c/svg%3e");
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 5.8 2.4 2.4M8.2 5.8l-2.4 2.4'/%3e%3c/svg%3e");
}
