/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding-bottom: 60px; /* Added for footer space */
}

/* Header Styles */
header {
    background-color: #4CAF50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

.group-info {
    text-align: right;
}

.group-info h2 {
    margin-bottom: 0.25rem;
    font-size: 1.2rem;
}

.group-info p {
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.group-info p:hover {
    text-decoration: underline;
}

/* Button Styles */
.btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

.btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.btn.delete {
    background-color: #f44336;
}

.btn.delete:hover {
    background-color: #d32f2f;
}

/* Container Styles */
.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.load-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.load-group input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-grow: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}

.close:hover {
    color: #333;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Calendar Styles */
.calendar-container {
    max-width: 100%;
    overflow-x: auto;
    margin: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
}

.timeline-header {
    display: flex;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 80px;
    z-index: 10;
}

.child-name-header {
    min-width: 150px;
    padding: 1rem;
    font-weight: bold;
    background-color: #f5f5f5;
    position: sticky;
    left: 0;
}

.dates-header {
    display: flex;
    min-width: calc(100% - 150px);
}

.date-header-cell {
    min-width: 100px;
    padding: 1rem;
    text-align: center;
    font-weight: bold;
    border-left: 1px solid #ddd;
}

.children-container {
    display: flex;
    flex-direction: column;
}

.child-row {
    display: flex;
    border-bottom: 1px solid #eee;
    position: relative;
}

.child-name {
    min-width: 150px;
    padding: 1rem;
    font-weight: bold;
    background-color: #f9f9f9;
    position: sticky;
    left: 0;
    z-index: 5;
}

.child-dates {
    display: flex;
    min-width: calc(100% - 150px);
}

.date-cell {
    min-width: 100px;
    padding: 0.5rem;
    border-left: 1px solid #eee;
    min-height: 60px;
    position: relative;
    transition: background-color 0.2s;
}

.date-cell:hover {
    background-color: rgba(76, 175, 80, 0.05);
}

.activity {
    background-color: #4CAF50;
    color: white;
    padding: 0.3rem 0.5rem;
    margin: 0.2rem 0;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: transform 0.2s;
}

.activity:hover {
    transform: scale(1.02);
}

/* Footer Styles */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #eee;
    z-index: 99;
}

footer a {
    color: #4CAF50;
    text-decoration: none;
}

/* Notification Styles */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
    max-width: 90%;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; bottom: 0; }
    to { opacity: 1; bottom: 20px; }
}

@keyframes fadeOut {
    from { opacity: 1; bottom: 20px; }
    to { opacity: 0; bottom: 0; }
}

/* Responsive Styles */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
    }
    
    .group-info {
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .child-name-header, .child-name {
        min-width: 120px;
        padding: 0.75rem;
    }
    
    .date-header-cell, .date-cell {
        min-width: 80px;
        padding: 0.5rem;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
    }

    footer {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .load-group {
        flex-direction: column;
    }
    
    .child-name-header, .child-name {
        min-width: 100px;
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .date-header-cell, .date-cell {
        min-width: 70px;
        padding: 0.3rem;
    }
    
    .activity {
        font-size: 0.75rem;
        padding: 0.2rem 0.3rem;
    }

    footer {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
}