/* --- Root Variables & Reset --- */
:root {
    --bg-color: #f6fbf7;
    --card-bg: #ffffff;
    --primary-green: #4CAF50;
    --accent-green: #81C784;
    --text-main: #24333a;
    --text-muted: #5c6d74;
    --light-grey: #ececec;
    --white: #ffffff;
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.1);
    --radius: 18px;
    --radius-pill: 50px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 600px;
    margin-top: 40px;
}

/* --- Header --- */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Planner Card --- */
.planner-card {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.planner-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="time"] {
    padding: 12px;
    border: 2px solid var(--light-grey);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}

input[type="time"]:focus {
    border-color: var(--accent-green);
}

/* --- Selection Groups (Pills) --- */
.selection-group {
    margin-bottom: 25px;
}

.selection-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.pill-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pill-group input[type="radio"] {
    display: none;
}

.pill-group label {
    background: var(--light-grey);
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0; /* Reset label margin */
    border: 2px solid transparent;
}

.pill-group input[type="radio"]:checked + label {
    background: var(--primary-green);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* --- Primary Button --- */
.primary-btn {
    width: 100%;
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    background: #43a047;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
}

.primary-btn:active {
    transform: scale(0.98);
}

/* --- Result Area --- */
.result-area {
    margin-top: 40px;
    padding-bottom: 60px;
}

.result-area.hidden {
    display: none;
}

.result-title {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Individual Result Cards --- */
.meal-card {
    background: var(--white);
    padding: 20px 24px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-soft);
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.meal-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.meal-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-green);
}

.divider {
    height: 1px;
    background: var(--light-grey);
    margin: 8px 0;
}

/* --- Info Section --- */
.info-section {
    margin-top: 40px;
    background: rgba(129, 199, 132, 0.1);
    padding: 24px;
    border-radius: var(--radius);
    border-left: 5px solid var(--primary-green);
}

.info-section h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-section p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

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

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
    .planner-card {
        padding: 20px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }

    .pill-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
}
/* Custom Time Input Styling */
.time-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-time-input {
    background: var(--bg-color);
    border: 2px solid var(--light-grey);
    border-radius: 14px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.custom-time-input:focus-within {
    border-color: var(--primary-green);
    background: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.1);
}

.custom-time-input input[type="time"] {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
}

/* Enhancing the Pill Group for more options */
.pill-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill-group label {
    font-size: 0.85rem; /* Slightly smaller to fit more options */
    padding: 8px 16px;
}
.premium-select {
    appearance: none; /* Removes default browser arrow */
    background: var(--bg-color);
    border: 2px solid var(--light-grey);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    width: 100%;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234CAF50' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C2.185 5.355 2.408 5 2.811 5h9.378c.403 0 .626.355.36.658l-4.796 5.482a.5.5 0 0 1-.748 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    transition: all 0.3s ease;
}

.premium-select:focus {
    border-color: var(--primary-green);
    background-color: white;
    outline: none;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.1);
}

.premium-select option {
    font-weight: 400;
}

/* Nutritional Tips Style */
.nutritional-tip {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f0f7f1;
    padding: 8px 12px;
    border-radius: 10px;
    margin-top: 10px;
    border-left: 3px solid var(--accent-green);
    font-style: italic;
}

.meal-card {
    flex-direction: column; /* Stack info and time/tips */
    align-items: flex-start;
}

.meal-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

/* Export Buttons */
.export-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.secondary-btn {
    flex: 1;
    background: white;
    border: 2px solid var(--light-grey);
    padding: 12px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.secondary-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}
