/* Baby Tracker - Heavenly Cloud Theme */
:root {
    --sky-blue: #87CEEB;
    --baby-blue: #89CFF0;
    --light-blue: #B0E0E6;
    --cloud-white: #F0F8FF;
    --text-dark: #2C3E50;
    --text-light: #5A6C7D;
    --success: #4CAF50;
    --danger: #F44336;
    --warning: #FF9800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 50%, #FFFFFF 100%);
    min-height: 100vh;
    color: var(--text-dark);
    position: relative;
    overflow-x: hidden;
}

/* Animated Cloud Background */
.clouds-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.clouds-bg::before,
.clouds-bg::after {
    content: '';
    position: absolute;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 50"><ellipse cx="25" cy="25" rx="25" ry="15" fill="rgba(255,255,255,0.3)"/><ellipse cx="45" cy="28" rx="20" ry="12" fill="rgba(255,255,255,0.4)"/><ellipse cx="65" cy="23" rx="18" ry="11" fill="rgba(255,255,255,0.3)"/></svg>') repeat-x;
    width: 200%;
    height: 200px;
    animation: clouds 60s linear infinite;
}

.clouds-bg::before {
    top: 50px;
    animation-duration: 45s;
}

.clouds-bg::after {
    top: 150px;
    animation-duration: 75s;
    opacity: 0.7;
}

@keyframes clouds {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--baby-blue) 0%, var(--sky-blue) 100%);
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.header-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header-subtitle {
    font-size: 1.2em;
    opacity: 0.95;
}

/* Navigation */
.main-nav {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 0;
}

.main-nav .container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 20px;
}

.nav-btn {
    background: var(--cloud-white);
    border: 2px solid var(--light-blue);
    color: var(--text-dark);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    background: var(--light-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--baby-blue), var(--sky-blue));
    color: white;
    border-color: var(--baby-blue);
}

/* Main Content */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 300px);
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Titles */
.section-title {
    font-size: 2em;
    color: var(--text-dark);
    margin-bottom: 25px;
    text-align: center;
}

.subsection-title {
    font-size: 1.5em;
    color: var(--text-dark);
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--baby-blue);
}

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

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 3em;
    flex-shrink: 0;
}

.stat-content h3 {
    font-size: 1em;
    color: var(--text-light);
    margin-bottom: 8px;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--baby-blue);
    margin-bottom: 5px;
}

.stat-detail {
    font-size: 0.9em;
    color: var(--text-light);
}

/* Records List */
.recent-section {
    margin-bottom: 30px;
}

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

.record-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease;
}

.record-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.record-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.record-content {
    flex-grow: 1;
}

.record-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.record-time {
    font-weight: bold;
    color: var(--baby-blue);
    font-size: 1.1em;
}

.record-detail {
    color: var(--text-light);
    margin-top: 5px;
}

.record-notes {
    color: var(--text-light);
    font-style: italic;
    margin-top: 8px;
    font-size: 0.9em;
}

.edit-btn {
    background: transparent;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 5px;
}

.edit-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.delete-btn {
    background: transparent;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    padding: 5px;
}

.delete-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.no-records {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
    font-style: italic;
}

/* Form Tabs */
.form-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.form-tab {
    background: white;
    border: 2px solid var(--light-blue);
    color: var(--text-dark);
    padding: 12px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.form-tab:hover {
    background: var(--cloud-white);
}

.form-tab.active {
    background: linear-gradient(135deg, var(--baby-blue), var(--sky-blue));
    color: white;
    border-color: var(--baby-blue);
}

/* Forms */
.record-form {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.record-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light-blue);
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--baby-blue);
}

.btn-submit {
    background: linear-gradient(135deg, var(--baby-blue), var(--sky-blue));
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* Charts */
.chart {
    margin-bottom: 40px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Export Options */
.export-options {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--baby-blue), var(--sky-blue));
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

/* Success/Error Messages */
.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header-title {
        font-size: 1.8em;
    }

    .main-nav .container {
        justify-content: flex-start;
    }

    .nav-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

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

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .form-tabs {
        justify-content: center;
    }

    .form-tab {
        font-size: 0.85em;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .header-title {
        font-size: 1.5em;
    }

    .section-title {
        font-size: 1.5em;
    }

    .record-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .delete-btn {
        align-self: flex-end;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: block;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.3s ease;
}

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

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 35px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--baby-blue);
}

.modal-title {
    color: var(--baby-blue);
    margin-bottom: 25px;
    text-align: center;
}

#editFormContainer .record-form {
    display: block;
    background: transparent;
    box-shadow: none;
    padding: 0;
}
