/* ===================================
   Farmer Registry System - Custom Styles
   Agricultural Theme with Earth Tones
   =================================== */

/* Root Variables - Agricultural Color Palette */
:root {
    --primary-green: #2d6a4f;
    --secondary-green: #40916c;
    --light-green: #52b788;
    --earth-brown: #8b5a3c;
    --light-brown: #a67c52;
    --bg-light: #f8f9fa;
    --text-dark: #212529;
}

/* Global Styles */
body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure footer stays at bottom */
.container {
    flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-dark);
}

/* Minimum font size for readability */
body {
    font-size: 16px;
    line-height: 1.6;
}

/* ===================================
   Navigation Bar Customization
   =================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
}

/* Language Switcher Buttons */
.language-btn {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    border-width: 2px;
    transition: all 0.3s ease;
}

.language-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.language-btn.active {
    background-color: #fff;
    color: #2d6a4f;
    border-color: #fff;
    font-weight: 700;
}

.language-btn:not(.active) {
    opacity: 0.7;
}

/* ===================================
   Card & Tile Styles
   =================================== */
.card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.tile-card {
    min-height: 320px;
    cursor: pointer;
}

.tile-card:hover {
    border: 2px solid var(--secondary-green);
}

.tile-icon {
    transition: transform 0.3s ease;
}

.tile-card:hover .tile-icon i {
    transform: scale(1.1);
}

/* ===================================
   Button Styles
   =================================== */
.btn {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    min-height: 48px; /* Touch-friendly minimum */
    transition: all 0.3s ease;
}

.btn-lg {
    min-height: 52px;
    font-size: 1.1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Custom Green Button */
.btn-success {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-success:hover {
    background-color: var(--secondary-green);
    border-color: var(--secondary-green);
}

/* ===================================
   Form Elements
   =================================== */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #dee2e6;
    padding: 12px 16px;
    min-height: 48px; /* Touch-friendly */
    font-size: 16px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-green);
    box-shadow: 0 0 0 0.25rem rgba(45, 106, 79, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
}

/* ===================================
   OTP Input Fields
   =================================== */
.otp-input {
    width: 50px;
    height: 60px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

.otp-input:focus {
    border-color: var(--secondary-green);
    box-shadow: 0 0 0 0.25rem rgba(45, 106, 79, 0.25);
}

/* ===================================
   Tab Styles
   =================================== */
.nav-pills .nav-link {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    color: var(--text-dark);
    min-height: 48px;
}

.nav-pills .nav-link.active {
    background-color: var(--primary-green);
}

.nav-pills .nav-link:hover:not(.active) {
    background-color: #e9ecef;
}

/* ===================================
   Badge Styles
   =================================== */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 6px;
}

/* ===================================
   Alert Styles
   =================================== */
.alert {
    border-radius: 10px;
    border: none;
    padding: 16px 20px;
}

/* ===================================
   Stat Box Styles (Dashboard)
   =================================== */
.stat-box {
    padding: 20px;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: scale(1.05);
}

.stat-box h4 {
    font-size: 2rem;
    font-weight: 700;
    margin: 8px 0;
}

/* ===================================
   Profile Avatar
   =================================== */
.profile-avatar {
    display: inline-block;
}

.profile-avatar i {
    transition: transform 0.3s ease;
}

.profile-avatar:hover i {
    transform: scale(1.1);
}

/* ===================================
   Breadcrumb
   =================================== */
.breadcrumb {
    background-color: transparent;
    padding: 12px 0;
}

.breadcrumb-item a {
    color: var(--secondary-green);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ===================================
   Footer
   =================================== */
footer {
    margin-top: auto;
}

/* ===================================
   Loading Spinner
   =================================== */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ===================================
   Utility Classes
   =================================== */
.shadow-sm {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.shadow {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
}

.shadow-lg {
    box-shadow: 0 8px 24px rgba(0,0,0,0.16) !important;
}

/* Generous Whitespace */
.card-body {
    padding: 2rem;
}

/* ===================================
   Responsive Design - Mobile First
   =================================== */

/* Extra Small Devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    body {
        font-size: 14px;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .otp-input {
        width: 40px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .tile-card {
        min-height: auto;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .tile-card {
        min-height: 300px;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .tile-card {
        min-height: 320px;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .navbar, footer, .btn, .alert {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* ===================================
   Accessibility Improvements
   =================================== */
.btn:focus, .form-control:focus, .form-select:focus {
    outline: 2px solid var(--secondary-green);
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
}

.skip-to-main:focus {
    left: 0;
    top: 0;
    background: var(--primary-green);
    color: white;
    padding: 10px;
}

/* ===================================
   Animation Classes
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Smooth transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Remove transition from transform properties */
.tile-card, .btn, .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
