/* Custom styles for Forest Valuation System */

:root {
    /* Enhanced Forest Theme Color Palette */
    --forest-primary: #1E392A;       /* Dark forest green - main brand color */
    --forest-accent: #C2D94C;        /* Yellow-green - CTA and highlights */
    --forest-hover: #A8C341;         /* Darker yellow-green for hover states */
    
    /* Warm Light Backgrounds */
    --bg-warm-white: #FAFAF5;        /* Warm off-white - main background */
    --bg-cream: #F5F5F0;             /* Soft cream - section backgrounds */
    --bg-light-beige: #EFEFEA;       /* Light beige - alternating sections */
    
    /* Text Colors */
    --text-dark: #1E392A;            /* Dark forest for headers */
    --text-primary: #2A4D38;         /* Medium forest for body */
    --text-secondary: #4A6552;       /* Lighter forest for secondary */
    --text-muted: #6B7C71;           /* Muted green-gray */
    
    /* Accent Colors */
    --accent-light: #D4E374;         /* Light yellow-green */
    --accent-medium: #C2D94C;        /* Main yellow-green */
    --accent-dark: #A8C341;          /* Dark yellow-green */
    
    /* Status Colors */
    --success-color: #16a34a;
    --warning-color: #ca8a04;
    --info-color: #0891b2;
    
    /* Legacy mappings */
    --forest-green: #1E392A;
    --forest-light: #C2D94C;
}

/* Body and Layout */
body {
    font-family: sans-serif;
    line-height: 1.6;
    background-color: #FAFAF5;
    color: #2A4D38;
}

/* Logo constraints to prevent oversizing */
.navbar-brand img {
    height: 32px !important;
    width: auto !important;
    max-height: 32px !important;
    max-width: none !important;
    object-fit: contain !important;
}

footer img {
    height: 40px !important;
    width: auto !important;
    max-height: 40px !important;
    max-width: none !important;
    object-fit: contain !important;
}

/* Hero Section */
.hero-section {
    background-image: url('/static/images/hero-forest-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    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: linear-gradient(rgba(30, 57, 42, 0.5), rgba(30, 57, 42, 0.7));
    z-index: 1;
}

.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;
}

/* Mobile override fix */
@media (max-width: 768px) {
    .hero-section {
        background-image: url('/static/images/hero-forest-bg.png') !important;
        background-size: cover !important;
        background-position: center !important;
    }
}

.hero-section h1,
.hero-section .display-4,
.hero-section .lead,
.hero-section .text-white {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Cards */
.card {
    font-family: sans-serif;
    border: none;
    border-radius: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #FAFAF5;
    box-shadow: 0 1px 3px rgba(30, 57, 42, 0.1), 0 1px 2px rgba(30, 57, 42, 0.06);
    border: 1px solid #E5E5E0;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-family: sans-serif;
    border-radius: 16px 16px 0 0 !important;
    padding: 1.5rem;
    font-weight: 600;
    background-color: #F5F5F0;
    border-bottom: 1px solid #E5E5E0;
    color: #1E392A;
}

.card-body {
    font-family: sans-serif;
    padding: 1.5rem;
}

.card-title {
    font-family: sans-serif;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.card-text {
    font-family: sans-serif;
    font-weight: 400;
    color: #64748b;
    line-height: 1.6;
}

/* Forms */
.form-control {
    font-family: sans-serif;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 0.875rem 1.125rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form-control:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.06);
    outline: none;
}

.form-control::placeholder {
    font-family: sans-serif;
    color: #94a3b8;
    font-weight: 400;
}

.btn {
    font-family: sans-serif;
    border-radius: 12px;
    padding: 0.875rem 1.75rem;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-lg {
    padding: 1.125rem 2.25rem;
    font-size: 1.1rem;
    border-radius: 14px;
}

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

/* Typography improvements */
.list-group-item {
    font-family: sans-serif;
    border: 1px solid #e2e8f0;
    color: #374151;
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8fafc;
}

.text-success {
    font-family: sans-serif;
    color: #059669 !important;
    font-weight: 600;
}

.text-primary {
    font-family: sans-serif;
    color: #3b82f6 !important;
    font-weight: 600;
}

.text-warning {
    font-family: sans-serif;
    color: #f59e0b !important;
    font-weight: 600;
}

.text-danger {
    font-family: sans-serif;
    color: #dc2626 !important;
    font-weight: 600;
}

/* Navigation */
.navbar {
    font-family: sans-serif;
}

.navbar-brand {
    font-family: sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: #1e293b;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: #334155;
}

/* Navigation styles moved to base.html for better control */

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Footer */
footer {
    font-family: sans-serif;
    margin-top: auto;
}

footer .text-muted {
    font-family: sans-serif;
    color: #adb5bd !important;
    font-weight: 400;
}

footer h5, footer h6 {
    font-family: sans-serif;
    color: #ffffff !important;
    font-weight: 600;
    margin-bottom: 1rem;
}

footer p {
    font-family: sans-serif;
    color: #adb5bd !important;
    font-weight: 400;
    line-height: 1.6;
}

footer a {
    font-family: sans-serif;
    color: #adb5bd !important;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

footer li {
    font-family: sans-serif;
    margin-bottom: 0.5rem;
}

/* Admin Panel Specific */
.admin-panel {
    font-family: sans-serif;
}

.admin-panel .card {
    border-left: 4px solid var(--warning-color);
    font-family: sans-serif;
}

.admin-panel h1, .admin-panel h2, .admin-panel h3 {
    font-family: sans-serif;
    font-weight: 600;
    color: #1e293b;
}

/* Formula Preview */
.formula-preview {
    font-family: 'Courier New', monospace;
    border-left: 4px solid var(--info-color);
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
}

/* Breadcrumb styling */
.breadcrumb {
    font-family: sans-serif;
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    font-family: sans-serif;
    font-size: 0.9rem;
    color: #6b7280;
}

.breadcrumb-item.active {
    color: #374151;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #9ca3af;
}

/* Table Styling */
.table {
    font-family: sans-serif;
    margin-bottom: 0;
}

.table th {
    font-family: sans-serif;
    border-top: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--forest-green);
    background-color: #f8fafc;
    padding: 1rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    font-family: sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8fafc;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
    transition: background-color 0.2s ease;
}

/* Alert Enhancements */
.alert {
    font-family: sans-serif;
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

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

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #664d03;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #055160;
    border-left: 4px solid #0dcaf0;
}

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

/* Enhanced typography for all elements */
blockquote {
    font-family: sans-serif;
    font-style: italic;
    color: #64748b;
    border-left: 4px solid #e2e8f0;
    padding-left: 1rem;
    margin: 1.5rem 0;
}

.lead {
    font-family: sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: #475569;
    line-height: 1.6;
}

.small, small {
    font-family: sans-serif;
    font-size: 0.875rem;
    color: #6b7280;
}

.badge {
    font-family: sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
}

.dropdown-menu {
    font-family: sans-serif;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    font-family: sans-serif;
    font-weight: 400;
    color: #374151;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8fafc;
    color: #1e293b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        padding: 2rem 0;
    }
    
    .display-4 {
        font-family: sans-serif;
        font-size: 2.5rem;
        font-weight: 700;
    }
    
    .card-body {
        font-family: sans-serif;
        padding: 1.5rem;
    }
    
    .btn-lg {
        font-family: sans-serif;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    h1 {
        font-family: sans-serif;
        font-size: 2rem;
        font-weight: 600;
    }
    
    h2 {
        font-family: sans-serif;
        font-size: 1.75rem;
        font-weight: 600;
    }
    
    h3 {
        font-family: sans-serif;
        font-size: 1.5rem;
        font-weight: 600;
    }
    
    p, .lead {
        font-family: sans-serif;
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .form-control {
        font-family: sans-serif;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
}
}

@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");
}

/* Testimonial Cards Enhancement */
.testimonial-card {
    background: #FAFAF5;
    border: 1px solid #E5E5E0;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(30, 57, 42, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1E392A, #C2D94C);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(30, 57, 42, 0.15);
    border-color: rgba(194, 217, 76, 0.3);
}

.testimonial-card:hover::before {
    opacity: 1;
}

.testimonial-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.testimonial-card:hover .testimonial-avatar {
    transform: scale(1.1);
}

.testimonial-avatar-forest {
    background: linear-gradient(135deg, #1E392A 0%, #2A4D38 100%);
    color: white;
}

.testimonial-avatar-accent {
    background: linear-gradient(135deg, #C2D94C 0%, #A8C341 100%);
    color: #1E392A;
}

.testimonial-avatar-muted {
    background: linear-gradient(135deg, #4A6552 0%, #6B7C71 100%);
    color: white;
}

.testimonial-stars {
    color: #C2D94C;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.testimonial-quote {
    color: #2A4D38;
    font-size: 1rem;
    line-height: 1.7;
    position: relative;
    padding-left: 1rem;
}

.testimonial-quote::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -0.25rem;
    font-size: 2rem;
    color: rgba(194, 217, 76, 0.5);
    font-family: Georgia, serif;
}

/* Modern Form Container - Desktop */
@media (min-width: 992px) {
    .modern-form-container {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 24px;
        padding: 2.5rem;
        box-shadow: 0 20px 50px rgba(30, 57, 42, 0.15), 0 10px 20px rgba(30, 57, 42, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.8);
        transition: all 0.3s ease;
    }
    
    .modern-form-container:hover {
        box-shadow: 0 25px 60px rgba(30, 57, 42, 0.18), 0 12px 25px rgba(30, 57, 42, 0.1);
        transform: translateY(-2px);
    }
    
    .form-control-modern {
        background: #FAFAF5;
        border: 2px solid #E5E5E0;
        border-radius: 12px;
        padding: 1rem 1.25rem;
        font-size: 1rem;
        transition: all 0.3s ease;
        min-height: 56px;
    }
    
    .form-control-modern:focus {
        border-color: #C2D94C;
        background: #fff;
        box-shadow: 0 0 0 4px rgba(194, 217, 76, 0.15);
        outline: none;
    }
    
    .form-control-modern::placeholder {
        color: #6B7C71;
    }
    
    .input-wrapper {
        position: relative;
        margin-bottom: 1.25rem;
    }
    
    .input-group-modern {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .input-wrapper {
        position: relative;
        margin-bottom: 1rem;
    }
    
    .floating-label {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        color: #1E392A;
        margin-bottom: 0.5rem;
        transition: opacity 0.2s ease, max-height 0.2s ease;
        max-height: 30px;
        overflow: hidden;
    }
    
    .floating-label.hidden {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
    }
    
    .form-control-modern {
        background: #FAFAF5;
        border: 2px solid #E5E5E0;
        border-radius: 12px;
        padding: 1rem 1.25rem;
        font-size: 1rem;
        transition: all 0.3s ease;
        min-height: 56px;
        width: 100%;
    }
    
    .form-control-modern:focus {
        border-color: #C2D94C;
        background: #fff;
        box-shadow: 0 0 0 4px rgba(194, 217, 76, 0.15);
        outline: none;
    }
    
    .form-control-modern::placeholder {
        color: #9CA3AF;
    }
}
