/* Seed Breeder VLC — Custom Styles */

:root {
    --vlc-primary: #0d6efd;
    --vlc-success: #198754;
    --vlc-warning: #ffc107;
    --vlc-danger: #dc3545;
    --vlc-info: #0dcaf0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Main content offset for fixed navbar */
.main-content {
    padding-top: 76px;
    padding-bottom: 40px;
}

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    max-width: 400px;
    width: 100%;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

/* Dashboard cards */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    border-radius: 0.75rem;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 1.5rem;
}

/* VLC Table */
.vlc-table-wrapper {
    overflow-x: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.vlc-table {
    min-width: 100%;
    margin-bottom: 0;
}

.vlc-table thead th {
    background: var(--bs-primary);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
}

.vlc-table tbody td {
    vertical-align: middle;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
}

.vlc-table tbody tr:hover {
    background-color: #f8f9fa;
}

.vlc-table .crop-header {
    background-color: #e9ecef;
    font-weight: 600;
    font-size: 0.9rem;
}

.vlc-table .variety-name {
    font-weight: 500;
    min-width: 150px;
}

/* Editable cells */
.editable-cell {
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s;
}

.editable-cell:hover {
    background-color: #e7f1ff !important;
}

.editable-cell.editing {
    padding: 0 !important;
}

.editable-cell input {
    width: 100%;
    border: 2px solid var(--bs-primary);
    border-radius: 0;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    text-align: right;
    outline: none;
}

.editable-cell textarea {
    width: 100%;
    border: 2px solid var(--bs-primary);
    border-radius: 0;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    outline: none;
    resize: vertical;
    min-height: 60px;
}

.editable-cell .edit-hint {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #6c757d;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.editable-cell:hover .edit-hint {
    opacity: 1;
}

/* Cell saving state */
.editable-cell.saving {
    background-color: #fff3cd !important;
    position: relative;
}

.editable-cell.saving::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid #ffc107;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Cell saved state */
.editable-cell.saved {
    background-color: #d1e7dd !important;
    transition: background-color 0.3s;
}

.editable-cell.saved::after {
    content: '✓';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: #198754;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Comments section */
.comment-item {
    border-left: 3px solid var(--bs-primary);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.comment-item .comment-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Sidebar */
.sidebar {
    min-height: calc(100vh - 76px);
    background: white;
    border-right: 1px solid #dee2e6;
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover {
    background-color: #f8f9fa;
    color: var(--bs-primary);
}

.sidebar .nav-link.active {
    background-color: var(--bs-primary);
    color: white;
}

/* Year selector */
.year-selector .btn {
    min-width: 60px;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

/* Settings page */
.settings-nav .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.settings-nav .nav-link.active {
    background-color: var(--bs-primary);
    color: white;
}

.settings-nav .nav-link:hover:not(.active) {
    background-color: #f8f9fa;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--bs-primary) !important;
    color: white !important;
    border-color: var(--bs-primary) !important;
    border-radius: 0.375rem;
}

/* Badge styles */
.badge-soft-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-soft-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.badge-soft-danger {
    background-color: #f8d7da;
    color: #842029;
}

.badge-soft-info {
    background-color: #cff4fc;
    color: #055160;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content {
        padding-top: 68px;
    }

    .vlc-table {
        font-size: 0.8rem;
    }

    .vlc-table thead th,
    .vlc-table tbody td {
        padding: 0.375rem 0.5rem;
    }
}

/* Print styles */
@media print {
    .navbar, .sidebar, .btn, .editable-cell .edit-hint {
        display: none !important;
    }

    .main-content {
        padding-top: 0 !important;
    }

    .vlc-table thead th {
        background: #333 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
