/* Custom styles for the childcare learning ideas webapp */

:root {
    --primary-color: #7fb069;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #52a675;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f0f6ed;
    --dark-color: #2d4a3a;
    --sage-color: #d1e7cc;
    --forest-green: #5d7c60;
    --text-muted: #666;
    --text-dark: #333;
    --border-color: #ced4da;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--sage-color) 0%, var(--light-color) 100%);
    min-height: 100vh;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-brand .brand-logo {
    height: 32px;
    width: 32px;
    margin-right: 0.75rem;
    border-radius: 4px;
}

/* Age group sections */
.age-group-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid rgba(127, 176, 105, 0.2);
}

.age-group-title {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    font-weight: bold;
}

/* Theme containers */
.theme-container {
    background: rgba(240, 246, 237, 0.8);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    border: 1px solid rgba(127, 176, 105, 0.3);
    overflow: hidden;
    contain: paint;
    position: relative;
}

.theme-title {
    color: var(--forest-green);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Idea cards */
.idea-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(127, 176, 105, 0.2);
}

.idea-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(127, 176, 105, 0.3);
}

.idea-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-color);
}

.idea-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.idea-image.no-image {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
}

.idea-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.idea-title {
    color: var(--dark-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.idea-description {
    color: var(--secondary-color);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.idea-actions {
    margin-top: auto;
}

.idea-actions .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Management page styles */
.card {
    border: 1px solid rgba(127, 176, 105, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
}

/* Action buttons improvements */
.btn-group .btn-sm {
    padding: 6px 10px;
    font-size: 0.9rem;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-group .btn-sm i {
    font-size: 0.95rem;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none;
    font-weight: 600;
}

.card-header.bg-success {
    background-color: var(--primary-color) !important;
}

.card-header.bg-warning {
    background-color: var(--forest-green) !important;
}

.card-header.bg-info {
    background-color: var(--info-color) !important;
}

/* Age Group Filter Buttons */
.age-filter {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    padding: 12px 20px;
    margin: 0 5px;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(127, 176, 105, 0.2);
}

.age-filter:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(127, 176, 105, 0.3);
}

.age-filter.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(127, 176, 105, 0.4);
}

.age-filter i {
    margin-right: 8px;
}

/* Mobile Layout Improvements */
@media (max-width: 768px) {
    /* Mobile navigation brand text */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Compact mobile header with stable selectors */
    .page-header h1, .text-center h1.h2 {
        font-size: 1.4rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .page-header .mb-2, .text-center .mb-2 {
        font-size: 0.8rem;
        margin-bottom: 1rem !important;
    }
    
    .page-header .text-muted, .text-center .mb-2 .text-muted {
        font-size: 0.75rem;
    }
    
    /* Compact book list section for mobile */
    .book-list-section {
        padding: 12px;
        margin-bottom: 1.5rem;
    }
    
    .book-list-section h3 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .book-card {
        height: 90px;
        margin-bottom: 8px;
    }
    
    .book-content {
        padding: 8px;
    }
    
    .book-title {
        font-size: 0.8rem !important;
        margin-bottom: 2px !important;
    }
    
    .book-author {
        font-size: 0.7rem !important;
        margin-bottom: 4px !important;
    }
    
    .book-content .btn {
        font-size: 0.6rem !important;
        padding: 2px 6px !important;
    }
    
    /* Mobile-friendly age filter container */
    .age-filter-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        margin: 0 auto;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .age-filter {
        font-size: 0.75rem;
        padding: 8px 10px;
        margin: 2px;
        min-height: 44px; /* Better touch target */
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 1 auto;
        white-space: nowrap;
        border-radius: 18px;
    }
    
    .age-filter i {
        margin-right: 4px;
        font-size: 0.8rem;
    }
    
    /* Mobile container spacing */
    .container {
        padding-top: 1rem !important;
    }
    
    main.container-fluid {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    /* Mobile card improvements */
    .theme-cards-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .idea-card.compact {
        min-height: 220px;
        padding: 8px;
    }
    
    .idea-image-small {
        height: 120px;
        margin-bottom: 8px;
    }
    
    /* Mobile book cards - margin handled above */
    
    /* Mobile container padding */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Mobile age group sections */
    .age-group-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
    
    .age-group-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    /* Additional mobile styles */
    .theme-container {
        padding: 1rem;
    }
    
    .idea-image {
        height: 150px;
    }
    
    .idea-content {
        padding: 1rem;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Age Group Section Animation */
.age-group-section {
    transition: opacity 0.3s ease-in-out;
}

.theme-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-bottom: 24px;
    padding-top: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.theme-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 8px;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

/* Compact layout for horizontal age groups */
.idea-card.compact {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 4px;
    margin-bottom: 4px;
    border: 1px solid rgba(127, 176, 105, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-height: none;
    overflow: hidden;
    height: 100%;
    min-height: 260px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.idea-card.compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(127, 176, 105, 0.2);
}

.idea-image-small {
    width: 100%;
    height: 169px;
    flex-shrink: 0;
    order: 1;
    margin-bottom: 4px;
    margin-right: 0;
    margin-left: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--sage-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.idea-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.idea-image-small.no-image {
    background: var(--light-color);
    color: var(--primary-color);
}

.idea-content-compact {
    flex-grow: 1;
    order: 2;
    min-width: 0;
    text-align: center;
    overflow: hidden;
}

.idea-content-compact .idea-title {
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: var(--primary-color);
    font-weight: 600;
}

.idea-description-compact {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.3;
    padding: 6px 4px;
    text-align: left;
    overflow: hidden;
    word-break: break-word;
    height: auto;
}


.idea-actions .btn-xs {
    padding: 6px 10px;
    font-size: 0.85rem;
    margin-left: 3px;
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-title-compact {
    font-size: 1.2rem;
    color: var(--forest-green);
    margin-bottom: 12px;
    margin-top: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--sage-color);
    font-weight: 600;
}

/* Theme icons styling */
.theme-title-compact i {
    color: #9db891 !important; /* Light sage green */
    margin-right: 8px;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Table styles */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.6em;
}


@media (max-width: 576px) {
    .display-5 {
        font-size: 2rem;
    }
    
    .display-6 {
        font-size: 1.75rem;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .idea-actions .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Alert improvements */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-info {
    background-color: #e7f3ff;
    color: #0c5460;
}

/* Form improvements */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    cursor: pointer;
}

/* Book List Styles */
.book-list-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(127, 176, 105, 0.2);
}

.book-card {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    height: 120px;
    border: 1px solid rgba(127, 176, 105, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.book-card.placeholder {
    opacity: 0.6;
}

.book-image {
    width: 33.33%;
    height: 120px;
    flex-shrink: 0;
    position: relative;
    background: #f8f9fa;
    overflow: hidden;
    border-radius: 8px 0 0 8px;
}

.book-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 120px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.book-image .fas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #ccc;
    margin: 0;
}

.book-content {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.2;
}

.book-author {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.2;
}

.book-content .btn {
    align-self: flex-end;
    font-size: 0.7rem;
    padding: 4px 8px;
}

/* Icon improvements */
.fas, .far {
    margin-right: 0.5rem;
}

.navbar .fas {
    margin-right: 0.25rem;
}

.book-content .fas {
    margin-right: 0.3rem;
}