/* ========================================
   JOURNAL PAGE STYLES - CARD GRID LAYOUT
   ======================================== */

/* ========================================
   LEGAL PAD BACKGROUND TREATMENT
   ======================================== */

/* Main journal body background */
.journal-main {
    background: linear-gradient(to bottom, #fef9e7 0%, #fdf5d9 100%);
    position: relative;
}

/* Legal pad paper texture overlay */
.journal-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Horizontal lines */
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            #e8d5b5 31px,
            #e8d5b5 32px
        );
    pointer-events: none;
    opacity: 0.4;
    z-index: 0;
}

/* Red margin line (left side) */
.journal-main::after {
    content: '';
    position: absolute;
    top: 0;
    left: 80px;
    bottom: 0;
    width: 2px;
    background: #e74c3c;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* Ensure content sits above background */
.journal-main > * {
    position: relative;
    z-index: 1;
}

/* Page Header - Sits on legal pad */
.journal-header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    background: transparent;
    border-bottom: 3px solid #2c7a7b;
    margin-bottom: 0;
}

.journal-header h1 {
    font-size: 2.5rem;
    color: #000000;
    margin: 0 0 0.5rem 0;
    text-shadow: none;
    font-weight: 700;
}

.journal-subtitle {
    font-size: 1.1rem;
    color: #2d3748;
    margin: 0;
    text-shadow: none;
    font-weight: 400;
}

/* ========================================
   DASHBOARD DISCOVERY ICON
   ======================================== */

.dashboard-icon {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    text-decoration: none;
    opacity: 0.4;
    transition: all 0.3s ease;
    z-index: 50;
    cursor: pointer;
    filter: grayscale(0.3);
}

.dashboard-icon:hover {
    opacity: 1;
    transform: scale(1.15) rotate(5deg);
    filter: grayscale(0);
}

.dashboard-icon:focus {
    opacity: 1;
    outline: 2px solid #2c7a7b;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Subtle pulse animation for discoverability */
@keyframes subtle-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.6; }
}

.dashboard-icon {
    animation: subtle-pulse 4s ease-in-out infinite;
}

.dashboard-icon:hover {
    animation: none;
}

/* Mobile positioning */
@media (max-width: 768px) {
    .dashboard-icon {
        top: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }
}

/* Print: hide the icon */
@media print {
    .dashboard-icon {
        display: none;
    }
}

/* ========================================
   STICKY DASHBOARD
   ======================================== */

.dashboard-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(254, 249, 231, 0.98);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid #d4af37;
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dashboard-sticky.is-pinned {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-card {
    background: #fffef9;
    border: 2px solid #e8d5b5;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
}

/* Paper texture on cards */
.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            rgba(232, 213, 181, 0.15) 31px,
            rgba(232, 213, 181, 0.15) 32px
        );
    pointer-events: none;
    border-radius: 8px;
}

.dashboard-card h2 {
    font-size: 1.3rem;
    color: #1a202c;
    margin: 0 0 1rem 0;
    position: relative;
    z-index: 1;
    font-weight: 700;
}

/* Parameters Card */
.param-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.param-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #cbd5e0;
    color: #1a202c;
}

.param-list li:last-child {
    border-bottom: none;
}

.param-value {
    color: #2c7a7b;
    font-weight: 700;
    font-size: 1.1rem;
}

.status-good {
    color: #38a169;
    font-weight: 700;
}

.status-warning {
    color: #d69e2e;
    font-weight: 700;
}

.status-alert {
    color: #e53e3e;
    font-weight: 700;
}

/* Feeding Card */
.feeding-update {
    font-size: 0.9rem;
    color: #718096;
    margin: 0 0 1rem 0;
}

.feeding-schedule {
    width: 100%;
    border-collapse: collapse;
    position: relative;
    z-index: 1;
}

.feeding-schedule td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #cbd5e0;
    background: transparent;
    color: #1a202c;
}

.feeding-schedule tr:last-child td {
    border-bottom: none;
}

.feeding-schedule td:first-child {
    font-weight: 700;
    color: #000000;
    width: 35%;
    border-right: 1px solid #cbd5e0;
}

.feeding-schedule td:last-child {
    color: #2d3748;
    font-weight: 400;
}

/* Alternating row tint for readability */
.feeding-schedule tr:nth-child(even) {
    background: rgba(232, 213, 181, 0.08);
}

/* ========================================
   MONTH NAVIGATION
   ======================================== */

.month-nav {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.month-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.month-nav a {
    display: block;
    padding: 0.75rem 1.5rem;
    background: #fffef9;
    color: #2c7a7b;
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    border: 2px solid #e8d5b5;
    border-bottom: none;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Paper tab lines */
.month-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            transparent,
            transparent 15px,
            rgba(232, 213, 181, 0.2) 15px,
            rgba(232, 213, 181, 0.2) 16px
        );
    pointer-events: none;
    border-radius: 8px 8px 0 0;
}

.month-nav a:hover {
    background: #fef9e7;
    transform: translateY(-2px);
    box-shadow: 2px -2px 6px rgba(0, 0, 0, 0.15);
}

.month-nav a.active {
    background: #2c7a7b;
    color: #ffffff;
    border-color: #2c7a7b;
}

.month-nav a.active::before {
    display: none;
}

/* ========================================
   MONTH SECTIONS
   ======================================== */

.month-section {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 1rem;
    scroll-margin-top: 180px; /* Account for sticky header */
}

.month-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #2c7a7b;
}

.month-header h2 {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 2.5rem;
    color: #000000;
    margin: 0 0 0.5rem 0;
}

.month-description {
    font-size: 1.1rem;
    color: #2d3748;
    margin: 0;
    font-weight: 400;
}

/* ========================================
   CARD GRID
   ======================================== */

.journal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    position: relative;
}

.journal-grid::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 5px;
    right: -5px;
    bottom: 5px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    z-index: -1;
}

/* ========================================
   COMING SOON NOTICE CARD
   ======================================== */

.journal-notice {
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
    border: 2px dashed #2c7a7b;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    grid-column: 1 / -1; /* Span full width */
    position: relative;
}

/* Paper texture on notice */
.journal-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            rgba(44, 122, 123, 0.05) 31px,
            rgba(44, 122, 123, 0.05) 32px
        );
    pointer-events: none;
    border-radius: 12px;
}

.journal-notice h3 {
    color: #2c7a7b;
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
    position: relative;
    z-index: 1;
    font-weight: 700;
}

.journal-notice p {
    color: #1a202c;
    line-height: 1.7;
    margin: 0.75rem 0;
    position: relative;
    z-index: 1;
}

.journal-notice strong {
    color: #2c7a7b;
    font-weight: 700;
}

.notice-subtext {
    font-size: 0.95rem;
    color: #4a5568;
    font-style: italic;
    margin-top: 1rem;
}

/* Base Card Styles */
.journal-card {
    background: #fffef9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        3px 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #e8d5b5;
    position: relative;
}

.journal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            rgba(232, 213, 181, 0.12) 31px,
            rgba(232, 213, 181, 0.12) 32px
        );
    pointer-events: none;
    z-index: 0;
}

.journal-card:hover {
    transform: translateY(-4px) rotate(0.5deg);
    box-shadow: 
        4px 8px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Card Header */
.card-header {
    padding: 1.5rem;
    background: rgba(247, 242, 232, 0.8);
    border-bottom: 2px solid #e8d5b5;
    position: relative;
    z-index: 1;
}

.card-icon {
    font-size: 1.5rem;
    display: inline-block;
    margin-right: 0.5rem;
}

.card-header h3 {
    font-size: 1.3rem;
    color: #000000;
    margin: 0.5rem 0;
    text-shadow: none;
    font-weight: 700;
}

.card-header time {
    display: block;
    font-size: 0.9rem;
    color: #4a5568;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Card Body */
.card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    background: transparent;
}

.card-body p {
    line-height: 1.7;
    color: #1a202c;
    margin-bottom: 1rem;
    text-shadow: none;
    font-weight: 400;
}

.card-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.card-body li {
    margin: 0.5rem 0;
    line-height: 1.6;
    color: #1a202c;
    font-weight: 400;
}

.card-body ul ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.card-body ul ul li {
    color: #2d3748;
}

.card-body li strong {
    color: #000000;
    font-weight: 700;
}

/* Recap Sections (for weekly cards) */
.recap-section {
    margin: 1.5rem 0;
}

.recap-section:first-child {
    margin-top: 0;
}

.recap-section h4 {
    font-size: 1.1rem;
    color: #2c7a7b;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed #2c7a7b;
    position: relative;
    z-index: 1;
}

.recap-section p {
    margin-bottom: 0.5rem;
    color: #1a202c;
    font-weight: 400;
}

.recap-section ul {
    margin-top: 0.5rem;
}

.recap-section li {
    color: #1a202c;
    font-weight: 400;
}

/* Card Footer */
.card-footer {
    padding: 1rem 1.5rem;
    background: rgba(247, 242, 232, 0.6);
    border-top: 1px solid #e8d5b5;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.card-tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    background: #e2e8f0;
    color: #2d3748;
    box-shadow: 
        1px 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Sticker shine effect */
.card-tag::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 50%;
    height: 40%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
    border-radius: 3px 0 0 0;
    pointer-events: none;
}

.tag-achievement {
    background: linear-gradient(135deg, #fef5e7 0%, #fcedd6 100%);
    color: #d69e2e;
    border-color: #d69e2e;
}

.tag-algae {
    background: linear-gradient(135deg, #e6fffa 0%, #d1f5ee 100%);
    color: #2c7a7b;
    border-color: #2c7a7b;
}

.tag-maintenance {
    background: linear-gradient(135deg, #ebf8ff 0%, #d6f0ff 100%);
    color: #3182ce;
    border-color: #3182ce;
}

.tag-water-change {
    background: linear-gradient(135deg, #e0f2fe 0%, #c7e9ff 100%);
    color: #0891b2;
    border-color: #0891b2;
}

/* Additional card tags for new categories */
.tag-milestone {
    background: linear-gradient(135deg, #fef5e7 0%, #fcf3cf 100%);
    color: #7d6608;
    border-color: #d4af37;
}

.tag-reflection {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #6a1b9a;
    border-color: #9c27b0;
}

/* ========================================
   STANDOUT MOMENT CARDS
   ======================================== */

.standout-moment {
    border-left: 6px solid #e53e3e;
    grid-column: span 1; /* Can make span 2 on larger screens if desired */
    background: #fffbf0;
}

.standout-moment .card-header {
    background: linear-gradient(135deg, rgba(255, 245, 230, 0.95) 0%, rgba(255, 250, 240, 0.85) 100%);
}

.standout-moment .card-icon {
    color: #e53e3e;
}

.standout-moment .celebration {
    background: linear-gradient(to right, transparent 0%, #fff4cc 3%, #fff4cc 97%, transparent 100%);
    border-left: 4px solid #d69e2e;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
    font-weight: 700;
    color: #5a2a0a;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.standout-moment .celebration::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 220, 100, 0.1) 2px,
            rgba(255, 220, 100, 0.1) 4px
        );
    pointer-events: none;
    border-radius: 4px;
}

/* ========================================
   WEEKLY RECAP CARDS
   ======================================== */

.weekly-recap {
    border-left: 4px solid #2c7a7b;
    background: #fffef9;
}

.weekly-recap .card-header {
    background: rgba(240, 253, 250, 0.6);
}

.weekly-recap .card-icon {
    color: #2c7a7b;
}

/* ========================================
   ARCHIVE MONTH SECTION
   ======================================== */

.archive-month {
    background: linear-gradient(135deg, #faf7f0 0%, #f5f0e6 100%);
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 
        3px 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 0 20px rgba(212, 175, 55, 0.1);
    position: relative;
}

.archive-month .month-header h2 {
    color: #000000;
}

.archive-month .month-description {
    color: #2d3748;
    font-weight: 400;
}

/* Aged paper texture */
.archive-month::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            rgba(180, 150, 100, 0.08) 31px,
            rgba(180, 150, 100, 0.08) 32px
        );
    pointer-events: none;
    border-radius: 8px;
}

.archive-link {
    display: inline-block;
    padding: 1rem 2rem;
    background: #2c7a7b;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.archive-link:hover {
    background: #285e61;
    transform: translateY(-2px);
    box-shadow: 3px 4px 8px rgba(0, 0, 0, 0.25);
}

/* ========================================
   MONTHLY ARCHIVE FULL PAGE
   ======================================== */

.monthly-archive-full {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fffef9;
    border: 2px solid #e8d5b5;
    border-radius: 12px;
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

/* Paper texture on archive page */
.monthly-archive-full::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            rgba(232, 213, 181, 0.12) 31px,
            rgba(232, 213, 181, 0.12) 32px
        );
    pointer-events: none;
    border-radius: 12px;
}

.archive-header {
    border-bottom: 3px solid #2c7a7b;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.breadcrumb {
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: #2c7a7b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.archive-header h1 {
    font-size: 2.2rem;
    color: #000000;
    margin: 0.5rem 0;
    font-weight: 700;
}

.archive-subtitle {
    font-size: 1.15rem;
    color: #2d3748;
    margin: 0.5rem 0;
    line-height: 1.6;
}

.archive-header time {
    display: block;
    font-size: 0.95rem;
    color: #4a5568;
    margin-top: 0.75rem;
    font-weight: 500;
}

.archive-body {
    position: relative;
    z-index: 1;
}

.archive-section {
    margin: 2.5rem 0;
}

.archive-section h2 {
    font-size: 1.5rem;
    color: #2c7a7b;
    margin: 0 0 1rem 0;
    font-weight: 700;
    border-bottom: 2px solid #e8d5b5;
    padding-bottom: 0.5rem;
}

.archive-section p {
    line-height: 1.8;
    color: #1a202c;
    margin-bottom: 1rem;
}

.archive-section ul {
    margin: 1rem 0;
    padding-left: 1.75rem;
}

.archive-section li {
    margin: 0.75rem 0;
    line-height: 1.7;
    color: #1a202c;
}

.archive-footer {
    border-top: 2px solid #e8d5b5;
    padding-top: 2rem;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.archive-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-button {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    background: #2c7a7b;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-button:hover {
    background: #285e61;
    transform: translateY(-2px);
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-button.next {
    background: #38a169;
}

.nav-button.next:hover {
    background: #2f855a;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .monthly-archive-full {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .archive-header h1 {
        font-size: 1.75rem;
    }
    
    .archive-nav {
        flex-direction: column;
    }
    
    .nav-button {
        text-align: center;
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .journal-header h1 {
        font-size: 2rem;
    }

    /* Reduce red margin line position on mobile */
    .journal-main::after {
        left: 20px;
    }

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

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

    /* Adjust card spacing */
    .journal-card {
        margin: 0 0.5rem;
    }

    /* Smaller paper texture lines on mobile */
    .journal-main::before,
    .dashboard-card::before,
    .journal-card::before {
        background-image: 
            repeating-linear-gradient(
                transparent,
                transparent 27px,
                rgba(232, 213, 181, 0.3) 27px,
                rgba(232, 213, 181, 0.3) 28px
            );
    }

    .month-nav-list {
        flex-direction: column;
    }

    .month-nav a {
        text-align: center;
    }

    .card-header h3 {
        font-size: 1.2rem;
    }

    .journal-notice {
        padding: 1.5rem;
    }
    
    .journal-notice h3 {
        font-size: 1.2rem;
    }
}

@media (min-width: 1024px) {
    /* Allow standout moments to span 2 columns on large screens */
    .standout-moment {
        grid-column: span 2;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles */
a:focus,
button:focus {
    outline: 3px solid #4299e1;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .dashboard-sticky,
    .month-nav {
        position: static;
    }

    .journal-main::before,
    .journal-main::after,
    .dashboard-card::before,
    .journal-card::before,
    .archive-month::before {
        display: none;
    }

    .journal-main {
        background: white;
    }

    .journal-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
