/* VeredApp Cultivos - Custom Styles */

/* Custom CSS Variables */
:root {
    --agri-primary: #16a34a;
    --agri-secondary: #22c55e;
    --agri-accent: #f59e0b;
    --agri-light: #f0fdf4;
    --agri-bg: #fafafa;
}

/* Flash Messages */
.flash-message {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    max-width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

.flash-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--agri-primary);
}

.flash-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.flash-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--agri-accent);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--agri-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Enhancements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: var(--agri-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-input:invalid {
    border-color: #dc2626;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: var(--agri-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #15803d;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.table tr:hover {
    background-color: #f9fafb;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-validated {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-purchased {
    background-color: #e0e7ff;
    color: #3730a3;
}

.badge-delivered {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid var(--agri-primary);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.3);
}

/* Tab Styles */
.tab-button {
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.tab-button.active {
    border-bottom-color: #059669;
    color: #059669;
}

.history-tab-button {
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    min-width: fit-content;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .history-tab-button {
        padding: 0.5rem 0.5rem;
        font-size: 0.875rem;
    }
}

.history-tab-button.active {
    border-bottom-color: #059669;
    color: #059669;
}

.history-tab-content {
    display: block;
}

.history-tab-content.hidden {
    display: none;
}