/* Reset ve Temel Stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px 25px;
    margin-top: -16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 5px;
}

.header-content h1 i {
    color: #667eea;
    margin-right: 15px;
}

.header-content p {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 400;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

/* Settings Button - Header içinde */
.btn-settings-top {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    flex-shrink: 0;
}

.btn-settings-top:hover {
    background: #5a6268;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.btn-settings-top i {
    font-size: 1.1rem;
}

/* Settings Button */
.btn-settings {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-settings:hover {
    background: #5a6268;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-settings i {
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.6);
}

.btn-danger {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

/* Header Search Container */
.header-search-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -10px;
    margin-bottom: 20px;
    padding: 0 5px;
    gap: 15px;
    flex-wrap: wrap;
}

/* Section Header */
.section-header {
    margin-bottom: 0;
    padding: 0;
    flex: 1;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

/* Search Container */
.search-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0;
    padding: 0;
    flex-shrink: 0;
}

.search-container input {
    width: 180px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.search-container input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Statistics */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2.5rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 15px;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-info p {
    color: #718096;
    font-weight: 500;
}

/* Children Section */
.children-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    margin-bottom: 20px;
}

/* Children Grid */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* Groups Container */
.groups-container {
    display: flex;
    gap: 30px;
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 20px;
}

/* Group Section */
.group-section {
    flex: 1;
    margin-bottom: 0;
}

.group-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0;
    padding: 10px 0 5px 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    margin-top: 0;
}

.group-title i {
    color: #667eea;
}

.children-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Child Card - Minimal Tasarım */
.child-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    width: 180px;
    min-height: 150px;
    max-height: 150px;
    margin: 0 auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

/* Card Actions Container */
.card-actions {
    position: relative;
}

/* WhatsApp Button */
.whatsapp-btn {
    background: #25D366;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
    margin: 0;
    padding: 0;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    background: #128C7E;
}

.whatsapp-btn i {
    color: white;
    font-size: 16px;
}

.child-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    z-index: 1;
}

.child-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.child-card:hover .card-detail-view {
    max-height: 300px;
    opacity: 1;
    padding: 20px;
}

.child-card:hover .expand-hint {
    opacity: 0;
    transform: translateY(-5px);
}

.child-card:hover .expand-hint i {
    transform: rotate(180deg);
}

.child-card:hover .card-date-info {
    background: #edf2f7;
}

/* Ana görünüm */
.card-main-view {
    padding: 10px 12px 8px;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 0;
}

/* Detay görünümü */
.card-detail-view {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
}

/* Tarih Bilgisi */
.card-date-info {
    text-align: center;
    padding: 6px 0;
    font-size: 0.6rem;
    color: #718096;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.card-date-info .date-label {
    font-weight: 600;
    color: #4a5568;
}

.card-date-info .date-value {
    font-weight: 500;
    color: #667eea;
}

/* Genişletme ipucu */
.expand-hint {
    text-align: center;
    padding: 8px 0;
    color: #a0aec0;
    font-size: 0.65rem;
    transition: all 0.3s ease;
    border-top: 1px dashed #e2e8f0;
    background: #f9fafb;
    width: 100%;
    flex-shrink: 0;
}

.expand-hint span {
    font-weight: 500;
    color: #667eea;
}

.child-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.health-icons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
}

.allergy-icon {
    color: #fff;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    border-radius: 50%;
    background: #f56565;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    line-height: 18px;
    text-align: center;
}

.allergy-icon::before {
    line-height: 18px;
}

.allergy-icon:hover {
    background: #e53e3e;
    transform: scale(1.1);
}

.medical-icon {
    color: #fff;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    border-radius: 50%;
    background: #e53e3e;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    line-height: 18px;
    text-align: center;
}

.medical-icon::before {
    line-height: 18px;
}

.medical-icon:hover {
    background: #c53030;
    transform: scale(1.1);
}

.child-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.child-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    padding: 0 4px;
    line-height: 1.2;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.4em;
    width: 100%;
}

.child-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.child-age {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    border: none;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
    min-width: 60px;
}

.child-group {
    background: #764ba2;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    border: none;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
    min-width: 60px;
}

.child-subgroup {
    background: #48bb78;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    border: none;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
    min-width: 60px;
}

/* Alt grup düzeni - Yatay */
.main-group-container {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sub-group-horizontal {
    display: flex;
    gap: 30px;
    justify-content: space-between;
}

.sub-group-column {
    flex: 1;
    min-width: 0;
}

.sub-group-title {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    justify-content: center;
    position: sticky;
    top: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 90;
    padding: 5px 0 10px 0;
    margin-top: -5px;
}

.sub-group-title i {
    color: #667eea;
}

.sub-group-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
    padding-bottom: 20px;
}

/* Scroll bar özelleştirmesi */
.sub-group-cards::-webkit-scrollbar {
    width: 6px;
}

.sub-group-cards::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sub-group-cards::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.sub-group-cards::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.empty-subgroup {
    text-align: center;
    padding: 15px;
    color: #a0aec0;
    font-style: italic;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* Çocuk kartları için ek stiller */

/* =====================
   RESPONSIVE - TABLET
   ===================== */
@media (max-width: 768px) {
    body {
        background-attachment: fixed;
    }

    .container {
        padding: 12px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 20px;
        margin-top: -12px;
        gap: 12px;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .header-content p {
        font-size: 0.95rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-actions .btn {
        padding: 9px 16px;
        font-size: 0.875rem;
    }


    .children-section {
        padding: 18px;
    }

    .header-search-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-top: 0;
        margin-bottom: 15px;
        padding: 0;
    }

    .section-header h2 {
        font-size: 1.4rem;
    }

    .search-container {
        width: 100%;
        justify-content: flex-start;
    }

    .search-container input {
        width: 100%;
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    /* Groups grid - mobilde tek sütun */
    .groups-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .group-card {
        padding: 20px !important;
    }

    .groups-container {
        flex-direction: column;
        gap: 20px;
    }

    .sub-group-horizontal {
        flex-direction: column;
        gap: 20px;
    }

    .child-card {
        width: 100%;
        max-width: 100%;
    }

    .sub-group-cards {
        align-items: stretch;
        max-height: none;
        padding-right: 0;
    }

    .child-tags {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    /* Grup Modal */
    #groupChildrenModal .modal-content {
        width: 98% !important;
        margin: 10px auto !important;
        max-height: 95vh !important;
    }

    #groupChildrenModalBody {
        max-height: 70vh !important;
    }

    /* Popup */
    .popup-modal {
        width: 96%;
        max-height: 94vh;
    }

    .popup-header {
        padding: 16px;
    }

    .child-main-info h2 {
        font-size: 18px;
    }

    .popup-content {
        padding: 14px;
        max-height: 60vh;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .popup-actions {
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px 16px;
    }

    .popup-actions .btn {
        max-width: none;
        width: 100%;
    }

    /* Form */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .child-form {
        padding: 20px;
    }

    .modal-content {
        width: 96%;
        max-height: 95vh;
        margin: auto;
    }

    .modal-header {
        padding: 18px 20px;
    }

    .form-group label {
        font-size: 0.95rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 13px 14px;
    }

    .form-actions,
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn,
    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Toast */
    .toast-container {
        top: 10px;
        right: 10px;
        left: auto;
        bottom: auto;
        max-width: calc(100vw - 20px);
    }

    .toast {
        min-width: auto;
        width: calc(100vw - 20px);
        max-width: 400px;
    }

    /* Stats */
    .stats-section {
        grid-template-columns: 1fr;
    }
}

/* =====================
   RESPONSIVE - MOBILE
   ===================== */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 14px 16px;
        border-radius: 16px;
    }

    .header-content h1 {
        font-size: 1.3rem;
    }

    .header-content p {
        font-size: 0.85rem;
    }

    .header-actions .btn {
        padding: 8px 13px;
        font-size: 0.8rem;
    }


    .children-section {
        padding: 14px;
        border-radius: 16px;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .group-card {
        padding: 16px !important;
        border-radius: 16px !important;
    }

    .group-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stat-box {
        padding: 12px !important;
    }

    .stat-number {
        font-size: 1.6rem !important;
    }

    /* Child card */
    .child-card {
        width: 100%;
        max-width: 100%;
    }

    .card-main-view {
        padding: 10px 12px 8px;
    }

    .child-name {
        font-size: 0.9rem;
    }

    .child-age,
    .child-group,
    .child-subgroup {
        font-size: 0.6rem;
        padding: 3px 8px;
    }

    /* Popup - ortalanmış */
    .popup-overlay {
        align-items: center;
        padding: 10px;
    }

    .popup-modal {
        width: 95%;
        max-width: 480px;
        border-radius: 16px;
        position: relative;
        bottom: auto;
        margin: 0 auto;
        max-height: 90vh;
        overflow-y: auto;
        transform: none !important;
    }

    .popup-overlay.show .popup-modal {
        transform: none !important;
    }

    .popup-content {
        max-height: 60vh;
    }

    .info-item label {
        font-size: 11px;
    }

    .info-item span {
        font-size: 12px;
    }

    /* Form modal - ortalanmış */
    .modal.show {
        align-items: center;
        padding: 10px;
    }

    .modal-content {
        width: 95%;
        border-radius: 16px;
        position: relative;
        bottom: auto;
        left: auto;
        margin: 0 auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .child-form {
        padding: 16px;
    }

    .modal-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-radius: 16px 16px 0 0;
    }

    /* Form inputları - mobil dokunma büyütme */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 13px 14px;
        border-radius: 10px;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Confirm modal */
    .confirm-modal {
        width: 94%;
        margin: 10px;
    }

    /* Group children modal - içerik düzeni */
    #groupChildrenModal .modal-content {
        width: 96% !important;
        border-radius: 15px !important;
        position: relative !important;
        bottom: auto !important;
        margin: 20px auto !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
    }

    #groupChildrenModalBody {
        max-height: 65vh !important;
        overflow-y: auto !important;
    }

    /* Group children - tek sütun kart görünümü */
    #groupChildrenModalBody div[style*="grid-template-columns: 1fr 1fr"] {
        display: block !important;
    }

    /* Health popup */
    .health-popup {
        width: 95%;
    }

    /* Grup başlık fontu */
    .group-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 22px !important;
    }

    .group-info h3 {
        font-size: 1.2rem !important;
    }
}

.parent-info {
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(224, 232, 240, 0.3);
}

.parent-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.parent-info h4 i {
    color: #667eea;
    font-size: 1.1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #718096;
    padding: 8px 0;
    transition: all 0.2s ease;
}

.contact-item:hover {
    color: #4a5568;
    transform: translateX(5px);
}

.contact-item i {
    color: #667eea;
    width: 18px;
    font-size: 1rem;
    text-align: center;
}

.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(224, 232, 240, 0.3);
}

.card-actions .btn {
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
    border-radius: 10px;
    font-weight: 600;
}

/* Health Popup */
.health-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.health-popup {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.health-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.health-popup-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-popup-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.health-popup-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.health-popup-content {
    padding: 25px;
    font-size: 1rem;
    line-height: 1.6;
    color: #2d3748;
    min-height: 80px;
}

.health-popup-content p {
    margin: 0;
    white-space: pre-wrap;
}

.health-popup-footer {
    background: #f7fafc;
    padding: 15px 25px;
    border-top: 1px solid #e2e8f0;
}

.health-popup-footer .child-name {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f7fafc;
    color: #4a5568;
}

/* Form */
.child-form {
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: #667eea;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* View Modal */
.view-content {
    padding: 20px 25px;
}

.view-section {
    margin-bottom: 16px;
}

.view-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-section h3 i {
    color: #667eea;
}

.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.view-item {
    background: #f7fafc;
    padding: 10px 12px;
    border-radius: 10px;
}

.view-item label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #718096;
    display: block;
    margin-bottom: 5px;
}

.view-item span {
    font-size: 1rem;
    color: #2d3748;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 14px 25px;
    border-top: 1px solid #e2e8f0;
}

/* Loading & Empty States */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #718096;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #667eea;
}

.empty-state {
    text-align: center;
    padding: 60px;
    color: #718096;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #cbd5e0;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #4a5568;
}

/* Child Details Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-modal {
    background: white;
    border-radius: 16px;
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    transform: scale(0.8) translateY(50px);
    transition: all 0.3s ease;
}

.popup-overlay.show .popup-modal {
    transform: scale(1) translateY(0);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.popup-close .close-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.popup-close .close-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: scale(1.1);
}

.popup-body {
    padding: 0;
}

.popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 18px;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.popup-health-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="80" cy="40" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="40" cy="80" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    border-radius: 16px 16px 0 0;
}

.child-main-info {
    position: relative;
    z-index: 1;
}

.child-main-info h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.child-tags-popup {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.child-age-popup,
.child-group-popup,
.child-subgroup-popup {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.popup-content {
    padding: 12px 18px;
    max-height: 70vh;
    overflow-y: auto;
}

.popup-content::-webkit-scrollbar {
    width: 6px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.info-section {
    margin-bottom: 10px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-section h3 i {
    color: #667eea;
    font-size: 18px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}

.info-item {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 10px;
    border-left: 3px solid #667eea;
}

.info-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.info-item span {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.health-section {
    border: 2px solid #ffeaa7;
    border-radius: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #fff9e6 0%, #ffeaa7 100%);
}

.health-section h3 {
    color: #d63031;
    margin-bottom: 12px;
}

.health-section h3 i {
    color: #d63031;
}

.health-content {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #d63031;
}

.health-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Emergency Contact Section */
.emergency-section {
    border: 2px solid #ff7675;
    border-radius: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #ffe8e8 0%, #ffcccb 100%);
}

.emergency-section h3 {
    color: #d63031;
    margin-bottom: 12px;
}

.emergency-section h3 i {
    color: #d63031;
}

.emergency-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.emergency-item {
    background: white;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #d63031;
    display: flex;
    align-items: center;
    gap: 8px;
}

.emergency-item i {
    color: #d63031;
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.emergency-item span {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.popup-actions {
    padding: 12px 24px 16px;
    display: flex;
    gap: 12px;
    justify-content: center;
    border-top: 1px solid #eee;
}

.popup-actions .btn {
    flex: 1;
    max-width: 140px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.popup-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    pointer-events: none;
    /* Container tıklamaları bloke etmemeli */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    max-width: calc(100vw - 40px);
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #667eea;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    pointer-events: auto;
    /* Her toast tıklanabilir */
}

.toast.success {
    border-left-color: #48bb78;
}

.toast.error {
    border-left-color: #f56565;
}

.toast.warning {
    border-left-color: #ed8936;
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i {
    color: #48bb78;
}

.toast.error i {
    color: #f56565;
}

.toast.warning i {
    color: #ed8936;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.9rem;
    color: #718096;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* View modal responsive */
@media (max-width: 480px) {
    .view-content {
        padding: 16px;
    }

    .view-grid {
        grid-template-columns: 1fr;
    }
}

/* WhatsApp Status ve QR Code Stilleri */
.whatsapp-status-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.whatsapp-quick-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-indicator.ready {
    color: #22c55e;
}

.status-indicator.qr {
    color: #f59e0b;
}

.status-indicator.loading {
    color: #6b7280;
}

.status-indicator.disconnected {
    color: #ef4444;
}

.status-indicator i {
    font-size: 0.8rem;
}

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

.btn-outline-success {
    background: transparent;
    color: #22c55e;
    border: 2px solid #22c55e;
}

.btn-outline-success:hover {
    background: #22c55e;
    color: white;
    transform: translateY(-1px);
}

/* Custom Confirm Modal */
.confirm-modal-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease;
}

.confirm-modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    margin: 20px;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
}

.confirm-modal-overlay.show .confirm-modal {
    transform: scale(1);
    opacity: 1;
}

.confirm-modal-header {
    padding: 25px 25px 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.confirm-modal-header i {
    font-size: 2.5rem;
    color: #ff6b6b;
    margin-bottom: 10px;
    display: block;
}

.confirm-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
}

.confirm-modal-body {
    padding: 20px 25px;
    text-align: center;
}

.confirm-modal-body p {
    margin: 0;
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
}

.confirm-modal-footer {
    padding: 15px 25px 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-modal-footer .btn {
    flex: 1;
    max-width: 120px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-modal-footer .btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.confirm-modal-footer .btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

.confirm-modal-footer .btn-danger {
    background: #dc3545;
    color: white;
}

.confirm-modal-footer .btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* QR Modal Stilleri */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.qr-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.qr-modal-header {
    padding: 25px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qr-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qr-modal-header h3 i {
    color: #25d366;
}

.qr-modal-body {
    padding: 25px;
    text-align: center;
}

.qr-container {
    background: #f9fafb;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #6b7280;
}

.qr-loading i {
    font-size: 2rem;
}

.qr-code-image {
    max-width: 250px;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.qr-instructions {
    text-align: center;
}

.qr-instructions p {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.qr-instructions i {
    color: #667eea;
}

@media (max-width: 768px) {
    .whatsapp-status-section {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .whatsapp-quick-status {
        gap: 10px;
    }

    .qr-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }

    .qr-container {
        padding: 20px;
        min-height: 250px;
    }

    .qr-code-image {
        max-width: 200px;
    }
}

/* WhatsA
pp Connection Status Icon */
.whatsapp-status {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-right: 15px;
    background: #e2e8f0;
}

.whatsapp-status.connected {
    background: linear-gradient(135deg, #25D366, #128C7E);
    animation: pulse 2s infinite;
}

.whatsapp-status.disconnected {
    background: linear-gradient(135deg, #fc8181, #f56565);
}

.whatsapp-status.connecting {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    animation: spin 1s linear infinite;
}

.whatsapp-status i {
    font-size: 1.3rem;
    color: white;
}

.whatsapp-status:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    }

    50% {
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.6);
    }
}

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

    100% {
        transform: rotate(360deg);
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* Group Children Modal Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal scrollbar styling */
#groupChildrenModalBody::-webkit-scrollbar {
    width: 8px;
}

#groupChildrenModalBody::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#groupChildrenModalBody::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

#groupChildrenModalBody::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}