/* General Styles */
.memory-tracking-system {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Stats Dashboard */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 600px;
    margin: 0 auto 30px auto;
    padding: 0 15px;
}

.stats-overview .memory-card {
    text-align: center;
    margin-bottom: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-overview .memory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-overview .memory-card .memory-content {
    padding: 25px 20px;
}

.stats-overview .memory-card h4 {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

.stats-overview .memory-card .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #0066cc;
    padding-bottom: 10px;
}

/* Memory Card Styles */
.memory-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.memory-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.tag-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.title-section {
    flex: 1;
}

.memory-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #0066cc;
    display: block;
    margin-bottom: 4px;
}

.tag-code {
    color: #666;
    font-size: 0.9em;
}

.header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.author-name {
    font-size: 0.9em;
    color: #666;
}

.memory-content {
    padding: 20px;
    line-height: 1.6;
}

.memory-content p {
    margin: 0 0 15px 0;
}

.memory-content p:last-child {
    margin-bottom: 0;
}

/* Form Styles */
.memory-submission-form {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group textarea:focus {
    border-color: #0066cc;
    outline: none;
}

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

.field-info,
.file-info {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

/* File Upload Styles */
.media-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.media-input:hover {
    border-color: #0066cc;
}

.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.media-preview img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
}

/* Memory Media Display */
.memory-media {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 20px 20px 20px;
}

.media-item {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* Default to landscape 4:3 ratio */
    overflow: hidden;
    border-radius: 4px;
    background: #f8f9fa;
}

.media-item.portrait {
    padding-bottom: 133.33%; /* 3:4 ratio for portrait images */
}

.media-item.landscape {
    padding-bottom: 75%; /* 4:3 ratio for landscape images */
}

.media-item.square {
    padding-bottom: 100%; /* 1:1 ratio for square images */
}

.media-item img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #f8f9fa;
}

.media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.media-link:hover img {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Memory Footer */
.memory-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.memory-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.memory-date {
    color: #666;
    font-size: 0.9em;
}

.memory-location {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #0066cc;
    font-weight: 500;
}

/* Journey Timeline */
.journey-timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 20px;
}

.journey-item {
    position: relative;
    margin-bottom: 30px;
}

.journey-marker {
    position: absolute;
    left: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0066cc;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.journey-marker::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 12px;
    bottom: -42px;
    width: 2px;
    background: #e0e0e0;
    transform: translateX(-50%);
}

.journey-item:last-child .journey-marker::before {
    display: none;
}

.journey-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-left: 20px;
}

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

.journey-modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* Buttons */
.view-journey-btn {
    padding: 6px 12px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.view-journey-btn:hover {
    background: #0052a3;
    transform: translateY(-1px);
}

.submit-button {
    background: #0066cc;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background: #0052a3;
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading States */
.loading-indicator {
    display: none;
}

.form-loading .loading-indicator {
    display: inline-block;
}

.form-loading .button-text {
    display: none;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification.success-notification {
    background: #4CAF50;
}

.notification.error-notification {
    background: #f44336;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .memory-tracking-system {
        padding: 10px;
    }

    .stats-overview {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }

    .stats-overview .memory-card {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }

    .stats-overview .memory-card .memory-content {
        padding: 20px 15px;
    }

    .stats-overview .memory-card .stat-value {
        font-size: 24px;
    }

    .memory-media {
        grid-template-columns: 1fr;
    }

    .memory-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .journey-modal-content {
        width: 95%;
        margin: 20px auto;
    }

    .tag-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Location Search Styles */
.search-box {
    position: relative;
    margin-bottom: 10px;
}

.location-search {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.location-search:focus {
    border-color: #0066cc;
    outline: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.memory-tracking-system .lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: none;
}

.memory-tracking-system .lightbox {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memory-tracking-system .lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

.memory-tracking-system .lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.memory-tracking-system .lightbox-close {
    position: absolute;
    right: -40px;
    top: -40px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 1000000;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
}