/* DayVault Frontend Styles */
.dayvault-calendar {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dayvault-entries-container {
    /* Container for multiple entries */
}

.dayvault-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.dayvault-calendar-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.dayvault-nav-btn {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.dayvault-nav-btn:hover {
    background: #005a87;
}

.dayvault-calendar-grid {
    padding: 20px;
}

.dayvault-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 10px;
}

.dayvault-weekdays span {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: #666;
    background: #f0f0f0;
}

.dayvault-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #ddd;
}

.dayvault-day {
    /*background: white;*/
    border: none;
    padding: 15px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 50px;
    position: relative;
}

.dayvault-day:hover {
    background: #e3f2fd;
}

.dayvault-day.has-content {
    font-weight: 600;
    color: #0073aa;
}

.dayvault-day.has-content::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    background: #00a32a;
    border-radius: 50%;
}

.dayvault-day.active {
    background: #0073aa;
    color: white;
}

.dayvault-content-preview {
    padding: 20px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
}

.dayvault-entry-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dayvault-entry-title h4 {
    margin: 0;
    color: #333;
}

.dayvault-entry-icon {
    font-size: 20px;
}

.dayvault-entry-excerpt {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

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

.dayvault-read-more {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.dayvault-read-more:hover {
    text-decoration: underline;
}

.dayvault-share-btn {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* History Widget Styles */
.dayvault-history-widget {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.dayvault-widget-header {
    background: #0073aa;
    color: white;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
}

.dayvault-history-entries {
    padding: 15px;
}

.dayvault-history-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.dayvault-history-entry:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dayvault-entry-content h5 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.dayvault-entry-text {
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    margin: 0;
}

.dayvault-view-all {
    display: block;
    text-align: center;
    padding: 10px;
    background: #f0f0f0;
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.dayvault-view-all:hover {
    background: #e0e0e0;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dayvault-calendar-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .dayvault-days {
        font-size: 14px;
    }

    .dayvault-day {
        min-height: 40px;
        padding: 10px 5px;
    }

    .dayvault-entry-actions {
        flex-direction: column;
    }
}

.dayvault-date-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.dayvault-date-header h4 {
    margin: 0;
    color: #0073aa;
    font-size: 16px;
}


/* Entry item interaction styles */
.dayvault-entry-item {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dayvault-entry-item:hover {
    border-color: #0073aa;
    background: #f8fdff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.dayvault-entry-item.primary-entry {
    border-color: #0073aa;
    background: #f0f8ff;
}

.dayvault-entry-item.secondary-entry {
    border-color: #ddd;
    background: #f9f9f9;
    margin-top: 10px;
}

/* Highlighted entry state */
.dayvault-entry-item.dayvault-entry-selected {
    border-color: #0073aa;
    background: #e3f2fd;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.dayvault-entry-item.dayvault-entry-selected:hover {
    border-color: #005a87;
    background: #e1f5fe;
}

/* Modal styles */
.dayvault-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.dayvault-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.dayvault-modal-content {
    padding: 20px;
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: dayvault-modal-appear 0.3s ease-out;
}

@keyframes dayvault-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dayvault-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.dayvault-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #0073aa;
    flex: 1;
}

.dayvault-modal-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.dayvault-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.dayvault-modal-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.dayvault-modal-body {
    padding: 20px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.dayvault-modal-body h1,
.dayvault-modal-body h2,
.dayvault-modal-body h3,
.dayvault-modal-body h4,
.dayvault-modal-body h5,
.dayvault-modal-body h6 {
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
}

.dayvault-modal-body p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
}

.dayvault-modal-body ul,
.dayvault-modal-body ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.dayvault-modal-body li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.dayvault-modal-body a {
    color: #0073aa;
    text-decoration: none;
}

.dayvault-modal-body a:hover {
    text-decoration: underline;
}

.dayvault-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

.dayvault-modal-body blockquote {
    border-left: 4px solid #0073aa;
    padding-left: 15px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

.dayvault-modal-meta {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
}

.dayvault-modal-meta .dayvault-meta-item {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 5px;
}

.dayvault-modal-meta .dayvault-meta-label {
    font-weight: 600;
    color: #333;
}

.dayvault-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    text-align: right;
}

.dayvault-modal-footer .button {
    margin-left: 10px;
}

/* Responsive modal */
@media (max-width: 768px) {
    .dayvault-modal {
        padding: 10px;
    }

    .dayvault-modal-content {
        max-width: 100%;
        max-height: 95vh;
    }

    .dayvault-modal-header {
        padding: 15px;
    }

    .dayvault-modal-header h3 {
        font-size: 16px;
    }

    .dayvault-modal-body {
        padding: 15px;
        max-height: calc(95vh - 120px);
    }

    .dayvault-modal-footer {
        padding: 15px;
    }
}

/* Enhanced entry styling */
.dayvault-entry-item .dayvault-entry-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dayvault-entry-item .dayvault-entry-title h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.dayvault-entry-item .dayvault-entry-excerpt {
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    margin-bottom: 10px;
}

.dayvault-more-indicator {
    font-size: 12px;
    color: #0073aa;
    font-weight: 500;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

/* Click indicator */
.dayvault-entry-item::after {
    content: '👁️';
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.dayvault-entry-item {
    position: relative;
}

.dayvault-entry-item:hover::after {
    opacity: 0.6;
}

/* Update existing day styles for today */
.dayvault-day.dayvault-today {
    background: #fff3cd;
    border: 2px solid #ffc107;
    font-weight: bold;
}

.dayvault-day.dayvault-today.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dayvault-entry-item {
        padding: 12px;
        margin-bottom: 10px;
    }

    .dayvault-date-header h4 {
        font-size: 15px;
    }

    .dayvault-entry-item .dayvault-entry-title h5 {
        font-size: 13px;
    }
}

/* History Widget Popup Enhancements */

/* Make history entries clickable */
.dayvault-history-entry[data-entry-id] {
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 10px;
    margin: -10px;
}

.dayvault-history-entry[data-entry-id]:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* Selected entry highlighting */
.dayvault-history-entry.dayvault-entry-selected {
    background-color: #e3f2fd;
    border-left: 4px solid #0073aa;
}

/* Modal styles (if calendar modal doesn't exist) */
.dayvault-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dayvault-history-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.dayvault-history-modal .dayvault-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.dayvault-history-modal .dayvault-modal-header {
    background: #0073aa;
    color: white;
    padding: 20px;
    position: relative;
}

.dayvault-history-modal .dayvault-modal-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
}

.dayvault-history-modal .dayvault-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background 0.2s;
}

.dayvault-history-modal .dayvault-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dayvault-history-modal .dayvault-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.dayvault-history-modal .dayvault-modal-content p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.dayvault-history-modal .dayvault-modal-meta {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.dayvault-history-modal .dayvault-modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    text-align: right;
    border-top: 1px solid #dee2e6;
}

/* Entry icons and year styling in modal */
.dayvault-modal-title .dayvault-entry-icon {
    margin-right: 8px;
    font-size: 20px;
}

.dayvault-modal-title .dayvault-entry-year {
    font-weight: bold;
    color: #cce7ff;
}

/* Responsive modal */
@media (max-width: 768px) {
    .dayvault-history-modal .dayvault-modal-content {
        width: 95%;
        max-height: 85%;
        margin: 20px;
    }

    .dayvault-history-modal .dayvault-modal-header {
        padding: 15px;
    }

    .dayvault-history-modal .dayvault-modal-title {
        font-size: 16px;
        padding-right: 30px;
    }

    .dayvault-history-modal .dayvault-modal-body {
        padding: 15px;
        max-height: 50vh;
    }
}

/* Body lock when modal is open */
body.dayvault-modal-open {
    overflow: hidden;
}

/* Loading state for history entries */
.dayvault-history-entry.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Accessibility improvements */
.dayvault-history-entry[data-entry-id]:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Animation for entry selection */
.dayvault-history-entry.dayvault-entry-selected {
    animation: selectPulse 0.3s ease-out;
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
