/* ============================================================
   BREEDER RASYON HESAPLAMA STİLLERİ
   ============================================================ */

/* ---- Hero Şablon Butonları ---- */
.rasyon-templates-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    margin-bottom: 20px;
}

.templates-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rasyon-chip-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
}

.rasyon-chip-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    transform: translateY(-2px);
}

.rasyon-chip-btn.active {
    background: #ffffff;
    color: #0d7a3e;
    border-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ---- Ana Çalışma Alanı Layout ---- */
.rasyon-section {
    padding: 40px 0 80px;
    background: #f8fafc;
}

.rasyon-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* ---- Kart Stilleri ---- */
.r-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    padding: 24px;
    transition: box-shadow 0.2s;
}

.r-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.r-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.r-card-title i {
    color: #0d7a3e;
}

.r-card-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(13, 122, 62, 0.1);
    color: #0d7a3e;
}

/* ---- Adım 1: Hayvan Seçici ---- */
.animal-type-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.animal-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.animal-tab-btn i {
    font-size: 24px;
    color: #94a3b8;
    transition: color 0.2s;
}

.animal-tab-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.animal-tab-btn.active {
    border-color: #0d7a3e;
    background: rgba(13, 122, 62, 0.04);
    color: #0d7a3e;
}

.animal-tab-btn.active i {
    color: #0d7a3e;
}

.r-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.r-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.r-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.r-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.r-input {
    width: 100%;
    padding: 10px 14px;
    padding-right: 44px;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: all 0.2s;
}

.r-input:focus {
    border-color: #0d7a3e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 122, 62, 0.15);
}

.r-unit {
    position: absolute;
    right: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    pointer-events: none;
}

/* ---- Otomatik Hesaplanan İhtiyaçlar Rozet Kutusu ---- */
.requirements-summary-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px 20px;
}

.req-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.req-header-title {
    font-size: 13px;
    font-weight: 700;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.req-standard-tag {
    font-size: 11px;
    font-weight: 600;
    background: #166534;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 10px;
}

.req-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.req-stat-item {
    background: #ffffff;
    border: 1px solid rgba(22, 101, 52, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
}

.req-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 2px;
}

.req-stat-val {
    font-size: 15px;
    font-weight: 800;
    color: #14532d;
}

/* ---- Adım 2: Rasyon Tablosu & Yem Ekleme ---- */
.feed-add-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
}

.feed-select-wrap {
    flex: 1;
    min-width: 260px;
}

.feed-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: #ffffff;
    cursor: pointer;
}

.feed-select:focus {
    border-color: #0d7a3e;
    outline: none;
}

.r-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.r-btn-primary {
    background: #0d7a3e;
    color: #ffffff;
}

.r-btn-primary:hover {
    background: #0a6332;
    transform: translateY(-1px);
}

.r-btn-outline {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.r-btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.r-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ---- Rasyon Tablosu ---- */
.rasyon-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

.rasyon-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rasyon-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.rasyon-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.rasyon-table tbody tr:hover {
    background: #fbfcfe;
}

.feed-title-cell {
    font-weight: 600;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feed-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.feed-tag.kaba {
    background: #ecfdf5;
    color: #047857;
}

.feed-tag.kesif {
    background: #fef3c7;
    color: #b45309;
}

.feed-tag.protein {
    background: #fee2e2;
    color: #b91c1c;
}

.feed-tag.karma {
    background: #eff6ff;
    color: #1d4ed8;
}

.feed-tag.mineral {
    background: #f3e8ff;
    color: #6b21a8;
}

.table-input {
    width: 80px;
    padding: 6px 8px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: right;
    transition: all 0.2s;
}

.table-input:focus {
    border-color: #0d7a3e;
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 122, 62, 0.2);
}

.table-del-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.table-del-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.rasyon-table tfoot {
    background: #f8fafc;
    border-top: 2px solid #cbd5e1;
    font-weight: 700;
    color: #0f172a;
}

.rasyon-table tfoot td {
    padding: 14px;
}

/* ---- Adım 3: Dengeleme Analiz Kartları & Barlar ---- */
.analysis-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.meter-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
}

.meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.meter-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.meter-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.meter-badge.ok {
    background: #dcfce7;
    color: #15803d;
}

.meter-badge.warn {
    background: #fef3c7;
    color: #b45309;
}

.meter-badge.alert {
    background: #fee2e2;
    color: #b91c1c;
}

.meter-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.meter-numbers strong {
    color: #0f172a;
}

.meter-bar-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.meter-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.35s ease;
}

.meter-bar-fill.ok {
    background: linear-gradient(90deg, #10b981, #059669);
}

.meter-bar-fill.warn {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.meter-bar-fill.alert {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.meter-note {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
}

/* ---- Finansal & Bütçe Özeti ---- */
.financial-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.fin-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border-left: 4px solid #0d7a3e;
}

.fin-item.highlight {
    background: linear-gradient(135deg, #0d7a3e 0%, #15803d 100%);
    color: #ffffff;
    border-left: none;
}

.fin-item.highlight .fin-label {
    color: rgba(255, 255, 255, 0.85);
}

.fin-item.highlight .fin-val {
    color: #ffffff;
}

.fin-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.fin-val {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

.fin-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.fin-item.highlight .fin-sub {
    color: rgba(255, 255, 255, 0.75);
}

/* ---- Aksiyon Çubuğu ---- */
.rasyon-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

/* ---- Özel Yem Modal ---- */
.custom-feed-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.custom-feed-modal.active {
    display: flex;
}

.custom-feed-modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* ---- Yazdırma / Print Stilleri ---- */
@media print {
    body * {
        visibility: hidden;
    }
    #navbar, .nav-clock-bar, .page-hero, .rasyon-templates-bar, .feed-add-bar, .rasyon-actions-bar, .footer, .back-to-top, #toastContainer, .table-del-btn {
        display: none !important;
    }
    #rasyonWorkspace, #rasyonWorkspace * {
        visibility: visible;
    }
    #rasyonWorkspace {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        background: #ffffff;
    }
    .r-card {
        border: none;
        box-shadow: none;
        padding: 0;
        margin-bottom: 20px;
    }
}

/* ---- Responsive Ayarlar ---- */
@media (max-width: 768px) {
    .animal-type-tabs {
        grid-template-columns: 1fr;
    }
    .r-form-row {
        grid-template-columns: 1fr;
    }
    .rasyon-table th, .rasyon-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    .table-input {
        width: 65px;
        padding: 4px 6px;
    }
    .feed-add-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .feed-select-wrap {
        min-width: auto;
    }
}
