/* ========================================
   Tzuzoo Rescue - In Memoriam Page Styles
   ======================================== */

:root {
    --memorial-bg: #F8F9FA;
}

/* Header & Navigation */
.header {
    background: var(--background-white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px var(--shadow-light);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-purple);
}

.logo .tzu {
    color: var(--primary-green);
    margin-right: 0.2rem;
}

.logo .zoo {
    color: var(--primary-purple);
    margin-right: 0.3rem;
}

.logo .rescue {
    color: var(--text-medium);
    font-size: 1.2rem;
    font-weight: 500;
}

.logo i {
    margin-right: 10px;
    color: var(--primary-green);
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
}

.nav-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--primary-green);
    color: white;
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-purple);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    transition: color 0.3s ease;
}

.hamburger:hover {
    color: var(--primary-green);
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
    color: white;
    text-align: center;
    padding: 120px 0 60px;
    margin-top: 80px;
    position: relative;
}

.header-controls {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.back-link, .admin-link {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-link:hover, .admin-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    font-style: italic;
}

/* Rainbow Bridge Section */
.rainbow-bridge {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(180deg, var(--memorial-bg) 0%, white 100%);
}

.rainbow-bridge-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(142, 68, 173, 0.1);
    border-top: 4px solid var(--primary-purple);
}

.rainbow-paw {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 1rem;
    display: block;
}

.rainbow-bridge-content h2 {
    font-size: 2.2rem;
    color: var(--primary-purple);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.rainbow-quote {
    font-size: 1.15rem;
    color: var(--text-medium);
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.rainbow-caption {
    font-size: 1.1rem;
    color: var(--primary-green);
    font-weight: 600;
    font-style: italic;
}

@media (max-width: 768px) {
    .rainbow-bridge-content {
        padding: 2rem 1.5rem;
        margin: 0 15px;
    }

    .rainbow-bridge-content h2 {
        font-size: 1.8rem;
    }
}

/* Memorial Content */
.memorial-content {
    padding: 4rem 0;
}

.add-memorial-btn {
    background: var(--primary-green);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 3rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.add-memorial-btn:hover {
    background: var(--secondary-green);
    transform: translateY(-2px);
}

.memorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.memorial-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow-light);
    transition: all 0.3s ease;
    border-left: 5px solid var(--primary-green);
    position: relative;
}

.memorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(126, 211, 33, 0.2);
}

.memorial-card.featured {
    border-left-color: var(--primary-purple);
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
}

/* Memorial Grid Layout */
.memorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(450px, 100%), 1fr));
    gap: 2rem;
    margin: 3rem 0;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px;
}

.memorial-item {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 25px var(--shadow-light);
    transition: all 0.3s ease;
    border: 2px solid var(--border-light);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.memorial-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.memorial-name {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}

.memorial-content-row {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    flex: 1;
}

.memorial-left {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.memorial-sentiment {
    font-size: 1.2rem;
    color: var(--text-dark);
    line-height: 1.6;
    font-weight: 400;
    text-align: left;
    flex: 1;
    display: flex;
    align-items: center;
}

.memorial-donor {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
    text-align: left;
    margin-top: 1rem;
}

.memorial-right {
    flex: 0 0 60%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.memorial-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.memorial-image {
    width: 100%;
    max-width: 280px;
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    background: #000000;
    border: 2px solid var(--border-light);
}

.memorial-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.no-memorials {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    font-style: italic;
    font-size: 1.2rem;
}

.pet-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.family-name {
    color: var(--primary-green);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.memorial-message {
    color: var(--text-medium);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.memorial-date {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

.admin-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: none;
}

.admin-controls button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    margin-left: 0.5rem;
    padding: 0.3rem;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.admin-controls button:hover {
    background: var(--border-light);
}

.admin-controls .edit-btn:hover {
    color: var(--primary-green);
}

.admin-controls .delete-btn:hover {
    color: #e74c3c;
}

/* Featured Stories */
.featured-stories {
    background: var(--memorial-bg);
    padding: 4rem 0;
}

.story-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow-light);
    margin-bottom: 3rem;
    border-top: 5px solid var(--primary-purple);
}

.story-title {
    font-size: 2rem;
    color: var(--primary-purple);
    margin-bottom: 1rem;
    text-align: center;
}

.story-content {
    color: var(--text-medium);
    line-height: 1.8;
    font-size: 1.1rem;
}

.story-content p {
    margin-bottom: 1.5rem;
}

.story-author {
    text-align: right;
    color: var(--primary-green);
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 2rem;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.modal-title {
    color: var(--primary-purple);
    font-size: 1.5rem;
}

.close {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

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

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

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    background: var(--primary-green);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.btn:hover {
    background: var(--secondary-green);
}

.btn-secondary {
    background: var(--text-light);
}

.btn-secondary:hover {
    background: var(--text-medium);
}

/* Admin Panel */
.admin-mode .admin-controls {
    display: block;
}

.admin-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-purple);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.admin-toggle:hover {
    background: var(--secondary-purple);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        box-shadow: 0 5px 15px var(--shadow-light);
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-menu a {
        padding: 1rem 1.5rem;
        width: 100%;
    }

    .page-title {
        font-size: 2rem;
    }

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

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.spinner {
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Admin Panel Styles */
.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(5px);
}

.admin-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.admin-header {
    background: var(--primary-purple);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s;
}

.admin-close:hover {
    transform: scale(1.1);
}

.admin-content {
    padding: 30px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-light);
}

.admin-tab {
    padding: 15px 25px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-medium);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.admin-tab.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.memorial-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-green);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-medium);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.memorial-list {
    display: grid;
    gap: 15px;
}

.memorial-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    transition: all 0.3s;
}

.memorial-item:hover {
    border-color: var(--primary-purple);
    box-shadow: 0 5px 15px rgba(142, 68, 173, 0.1);
}

.memorial-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-green);
}

.memorial-info {
    flex: 1;
}

.memorial-info h4 {
    color: var(--primary-purple);
    margin-bottom: 5px;
}

.memorial-info p {
    color: var(--text-medium);
    font-size: 14px;
}

.memorial-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.password-protection {
    text-align: center;
    padding: 40px;
}

.password-input {
    width: 300px;
    max-width: 100%;
    padding: 15px;
    border: 2px solid var(--border-light);
    border-radius: 25px;
    font-size: 16px;
    text-align: center;
    margin: 20px 0;
}

.password-submit {
    background: var(--primary-green);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.password-submit:hover {
    background: var(--secondary-green);
    transform: translateY(-2px);
}

.password-error {
    color: #e74c3c;
    margin-top: 10px;
    display: none;
}

.photo-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    border: 2px solid var(--border-light);
}

.upload-progress {
    background: var(--border-light);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.upload-progress-bar {
    background: var(--primary-green);
    height: 100%;
    width: 0%;
    transition: width 0.3s;
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        box-shadow: 0 5px 15px var(--shadow-light);
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-menu a {
        padding: 1rem 1.5rem;
        width: 100%;
    }

    .memorial-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 10px;
    }

    .memorial-item {
        padding: 1.5rem;
        min-height: auto;
    }

    .memorial-content-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    .memorial-left {
        flex: none;
        text-align: center;
        order: 2;
    }

    .memorial-right {
        flex: none;
        order: 1;
    }

    .memorial-sentiment {
        font-size: 1rem;
        text-align: center;
        display: block;
    }

    .memorial-name {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .memorial-image {
        height: 180px;
        max-width: 100%;
    }

    .memorial-donor {
        font-size: 0.9rem;
        text-align: center;
    }

    .page-header {
        padding: 100px 15px 40px;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .header-controls {
        position: relative;
        top: auto;
        flex-direction: column;
        gap: 10px;
        align-items: center;
        margin-bottom: 20px;
    }

    .story-card {
        padding: 2rem;
    }

    .memorial-card {
        padding: 1.5rem;
    }

    .admin-panel {
        width: 95%;
    }

    .admin-content {
        padding: 20px;
    }

    .two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .memorial-item {
        padding: 1rem;
    }

    .memorial-name {
        font-size: 1.3rem;
    }

    .memorial-sentiment {
        font-size: 0.95rem;
    }

    .memorial-image {
        height: 150px;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .back-link, .admin-link {
        padding: 8px 14px;
        font-size: 12px;
    }
}
