/**
 * KiloCode Kertészet - Egyedi Stílusok
 * Zöldségtermesztési Adatrögzítő Webapp
 */

/* ============================================
   SZÍNEK ÉS VÁLTOZÓK
   ============================================ */
:root {
    --color-primary: #16a34a;
    --color-primary-dark: #15803d;
    --color-primary-light: #22c55e;
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    --color-bg-light: #f8fafc;
    --color-bg-white: #ffffff;
    --color-text-dark: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

/* ============================================
   ALAP STÍLUSOK
   ============================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--color-text-dark);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.025em;
}

.navbar-dark .navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   KÁRTYÁK ÉS PANELEK
   ============================================ */
.card {
    border-radius: var(--radius-lg);
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

/* ============================================
   IDŐJÁRÁS PANEL
   ============================================ */
.weather-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-lg);
    color: white;
}

.weather-card .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.weather-details span {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

/* ============================================
   STATISZTIKA KÁRTYÁK
   ============================================ */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: none;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* ============================================
   NÖVÉNY KÁRTYÁK
   ============================================ */
.plant-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.plant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.plant-image {
    height: 140px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.plant-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plant-placeholder {
    color: var(--color-primary);
    font-size: 3rem;
    opacity: 0.5;
}

.plant-info {
    padding: 1rem;
}

.plant-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text-dark);
}

.plant-meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.plant-actions {
    padding: 0 1rem 1rem;
}

/* ============================================
   TÁROLÁS LISTA
   ============================================ */
.storage-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.storage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--color-bg-light);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.storage-item:hover {
    background: var(--color-bg-white);
    box-shadow: var(--shadow-sm);
}

.storage-emoji {
    font-size: 1.75rem;
}

/* ============================================
   NÖVÉNYVÉDELEM LISTA
   ============================================ */
.protection-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.protection-item {
    padding: 0.75rem;
    background: var(--color-bg-light);
    border-radius: var(--radius);
    border-left: 3px solid var(--color-primary);
}

.protection-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 163, 74, 0.1);
    border-radius: 50%;
}

/* ============================================
   KÉP FELTÖLTÉS
   ============================================ */
.image-upload-preview {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--color-bg-light);
}

.image-upload-preview:hover,
.image-upload-preview.dragover {
    border-color: var(--color-primary);
    background: rgba(22, 163, 74, 0.05);
}

.image-upload-preview img {
    max-height: 200px;
    object-fit: contain;
}

/* ============================================
   GOMBOK
   ============================================ */
.btn {
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.btn-success {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-success:hover,
.btn-success:focus {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.btn-outline-success {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline-success:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ============================================
   ŰRLAPOK
   ============================================ */
.form-control,
.form-select {
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    padding: 0.625rem 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--color-text-dark);
    margin-bottom: 0.375rem;
}

/* ============================================
   TÁBLÁZATOK
   ============================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    color: var(--color-text-dark);
    border-bottom: 2px solid var(--color-border);
    padding: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(22, 163, 74, 0.04);
}

.table-success {
    --bs-table-bg: rgba(22, 163, 74, 0.08);
}

/* ============================================
   ALERTEK
   ============================================ */
.alert {
    border-radius: var(--radius);
    border: none;
}

.alert-success {
    background-color: rgba(22, 163, 74, 0.1);
    color: var(--color-primary-dark);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ============================================
   MODAL
   ============================================ */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
}

.modal-header {
    border-bottom: 1px solid var(--color-border);
}

.modal-footer {
    border-top: 1px solid var(--color-border);
}

/* ============================================
   BADGE-EK
   ============================================ */
.badge {
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.35em 0.65em;
}

/* ============================================
   TÖRLÉS MEGERŐSÍTÉS
   ============================================ */
.delete-confirm {
    cursor: pointer;
}

/* ============================================
   ANIMÁCIÓK
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ============================================
   RESZPONZÍV STÍLUSOK
   ============================================ */
@media (max-width: 768px) {
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .plant-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .navbar-brand span {
        display: none;
    }
}

@media (max-width: 576px) {
    .weather-details {
        display: none;
    }
}

/* ============================================
   NYOMTATÁSI STÍLUSOK
   ============================================ */
@media print {
    .navbar,
    .btn,
    .plant-actions {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}

/* ============================================
   ÉVSZAK SZÍNEK
   ============================================ */
.season-spring {
    background: linear-gradient(135deg, #86efac 0%, #4ade80 100%);
}

.season-summer {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
}

.season-autumn {
    background: linear-gradient(135deg, #fdba74 0%, #ea580c 100%);
}

.season-winter {
    background: linear-gradient(135deg, #bfdbfe 0%, #3b82f6 100%);
}

/* ============================================
   TOOLTIP STÍLUSOK
   ============================================ */
.tooltip-inner {
    background-color: var(--color-text-dark);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}

/* ============================================
   SCROLLBAR STÍLUSOK
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-dark);
}

/* ============================================
   SIKER/TÚLCSORDULÁS STÍLUSOK
   ============================================ */
.expiry-warning {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ============================================
   AI ASSZISZTENS WIDGET
   ============================================ */
#aiAssistant {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
}

.ai-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.4);
    animation: aiFloat 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.ai-avatar:hover {
    transform: scale(1.1);
}

.ai-avatar i {
    font-size: 1.5rem;
    color: white;
}

@keyframes aiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.ai-bubble {
    display: none;
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 280px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    animation: aiSlideUp 0.3s ease;
}

@keyframes aiSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-speech-bubble {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-dark);
    transition: opacity 0.3s ease;
}

.ai-speech-bubble::before {
    content: '🌱 ';
}

.ai-close {
    position: absolute;
    top: 6px;
    right: 8px;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    line-height: 1;
}

.ai-close:hover {
    color: var(--color-text-dark);
}

/* ============================================
   OFFLINE BANNER
   ============================================ */
#offlineBanner {
    font-size: 0.85rem;
    padding: 0.4rem;
}

@media (max-width: 576px) {
    #aiAssistant {
        bottom: 12px;
        right: 12px;
    }
    .ai-avatar {
        width: 48px;
        height: 48px;
    }
    .ai-bubble {
        width: 240px;
    }
}
