:root {
    --primary-bg: #fff0f5; /* LavenderBlush */
    --secondary-bg: #ffe4e1; /* MistyRose */
    --accent: #ffb6c1; /* LightPink */
    --text-main: #4a4a4a;
    --text-muted: #888;
    --card-bg: rgba(255, 255, 255, 0.8);
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 480px; /* Mobile focused max width */
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
    min-height: 100vh;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.3);
    position: relative;
    overflow-x: hidden;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

header h1 {
    font-size: 2rem;
    color: #e88d9b;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

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

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

.rundown-item {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 2px 10px rgba(255, 182, 193, 0.2);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    border-left: 5px solid var(--accent);
    position: relative;
    overflow: hidden;
}

.rundown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 182, 193, 0.1);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
    z-index: 0;
}

.rundown-item:hover, .rundown-item:active {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 182, 193, 0.4);
}

.rundown-item:hover::before, .rundown-item:active::before {
    transform: scaleX(1);
    transform-origin: left;
}

.rundown-item-content {
    position: relative;
    z-index: 1;
}

.rundown-time {
    font-weight: bold;
    color: #e88d9b;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.rundown-title {
    font-size: 1rem;
    font-weight: 500;
}

.rundown-arrow {
    color: var(--accent);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    z-index: 1;
}

.rundown-item:hover .rundown-arrow {
    transform: translateX(5px);
}

.detail-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
    animation: fadeIn 0.5s ease;
}

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

.detail-time {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.detail-title {
    font-size: 1.5rem;
    color: #e88d9b;
    margin-bottom: 15px;
}

.detail-desc {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 30px;
    white-space: pre-wrap;
}

.back-btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--card-bg);
    color: #e88d9b;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    border: 2px solid #e88d9b;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: #e88d9b;
    color: white;
    transform: scale(1.05);
}

/* Admin Styles */
.admin-form {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-main);
}

.form-group input, .form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 182, 193, 0.3);
}

.btn-submit {
    background-color: #e88d9b;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.btn-submit:hover {
    background-color: #d87d8b;
}

.admin-list table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
}

.admin-list th, .admin-list td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #fee;
}

.admin-list th {
    background-color: var(--secondary-bg);
    color: #e88d9b;
}

.action-btn {
    display: inline-block;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    margin-right: 5px;
    margin-bottom: 5px;
}

.btn-edit { background-color: #fca5a5; }
.btn-delete { background-color: #f87171; }

/* New styles for media */
.rundown-item-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.rundown-text {
    display: flex;
    flex-direction: column;
}

.rundown-thumb {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(255,182,193,0.5);
}

.detail-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.moment-section {
    background: rgba(255, 182, 193, 0.15);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
    border: 1px dashed var(--accent);
}

.moment-heading {
    color: #e88d9b;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-family: serif;
    font-style: italic;
}

.moment-photo {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #fff;
}

.moment-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-main);
    line-height: 1.6;
}

/* Grid & Modal Styles */
.moment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.moment-grid-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.moment-grid-item:hover {
    transform: scale(1.05);
}

.moment-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moment-grid-text-only {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-bg);
    color: var(--text-main);
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    font-style: italic;
    word-break: break-word;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.9);
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 20px;
}

.modal-text {
    color: white;
    font-size: 1.2rem;
    text-align: center;
    padding: 0 20px;
    font-style: italic;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.modal-prev, .modal-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(255,182,193,0.3);
    border-radius: 50%;
}

.modal-prev:hover, .modal-next:hover {
    background-color: rgba(255,182,193,0.8);
}

.modal-prev {
    left: 10px;
}

.modal-next {
    right: 10px;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #fffcfc;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-content {
    position: relative;
    width: 90px;
    height: 90px;
}
.heart-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 6px rgba(232, 141, 155, 0.2));
}
.heart-fill-rect {
    transform-origin: bottom;
    transform-box: fill-box;
    animation: fillHeart 1.5s ease-in-out infinite;
}
@keyframes fillHeart {
    0%, 15% { transform: scaleY(0); }
    85%, 100% { transform: scaleY(1.02); }
}
.loader-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(200, 100, 120, 0.4);
    z-index: 10;
}

/* Carousel Styles */
.carousel-container {
    width: 100%;
    margin-bottom: 5px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.3);
}
.carousel-track {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.carousel-slide {
    min-width: 100%;
    height: 220px;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
