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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #fafafa;
    color: #262626;
    line-height: 1.5;
}

.header {
    background: #ffffff;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.title {
    font-family: 'Pacifico', cursive;
    font-size: 2.2rem;
    font-weight: 400;
    color: #ffc2d1;
    letter-spacing: 0.5px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.upload-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: #262626;
    border: 1px solid #dbdbdb;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: auto;
}

.upload-btn:hover {
    background: #fafafa;
    transform: scale(1.05);
}

.upload-btn:active {
    transform: scale(0.95);
}

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

.grid {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.masonry-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.photo-card {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
    width: 100%;
}

.photo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.photo-image {
    width: 100%;
    display: block;
    pointer-events: none;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid #fafafa;
    border-top: 3px solid #ffc2d1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #8e8e8e;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.btn-primary, .btn-secondary {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: #ffc2d1;
    color: #262626;
}

.btn-primary:hover {
    background: #ffb3c6;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #fafafa;
    color: #262626;
    border: 1px solid #dbdbdb;
}

.btn-secondary:hover {
    background: #f0f0f0;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: #ffffff;
    max-width: 500px;
    margin: 50px auto;
    padding: 32px;
    border-radius: 12px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-photo {
    max-width: 900px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #262626;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.delete-photo-btn {
    position: absolute;
    top: 16px;
    right: 70px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    color: #262626;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.2s ease;
}

.delete-photo-btn:hover {
    background: #ffb3c6;
    transform: scale(1.1);
}

.delete-photo-btn svg {
    width: 20px;
    height: 20px;
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    font-weight: 600;
}

.upload-area {
    margin-bottom: 20px;
}

.upload-placeholder {
    border: 2px dashed #dbdbdb;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.upload-placeholder:hover {
    border-color: #ffc2d1;
    background: #fff5f7;
}

.upload-icon-large {
    font-size: 48px;
    color: #8e8e8e;
    margin-bottom: 12px;
}

.upload-placeholder p {
    color: #8e8e8e;
    font-size: 14px;
}

.preview-image {
    width: 100%;
    border-radius: 8px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #ffc2d1;
    background: #ffffff;
}

.photo-detail {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-height: 85vh;
}

.photo-detail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.photo-info {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 24px;
    overflow-y: auto;
}

.photo-caption {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.photo-date {
    font-size: 12px;
    color: #8e8e8e;
    margin-bottom: 20px;
}

.photo-actions {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid #efefef;
    border-bottom: 1px solid #efefef;
    margin-bottom: 20px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #262626;
    transition: all 0.2s ease;
    padding: 8px;
}

.action-btn:hover {
    opacity: 0.7;
}

.action-btn svg {
    width: 24px;
    height: 24px;
}

#likeIcon {
    font-size: 28px;
    transition: all 0.3s ease;
}

.liked #likeIcon {
    color: #ffc2d1;
}

.like-count {
    font-size: 14px;
    font-weight: 600;
    color: #262626;
}

.comments-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
}

.comment {
    margin-bottom: 16px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    position: relative;
}

.comment-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.comment-text {
    color: #262626;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.delete-comment-btn {
    background: none;
    border: none;
    color: #8e8e8e;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.delete-comment-btn:hover {
    background: #ffc2d1;
    color: #ffffff;
    transform: scale(1.1);
}

.delete-comment-btn svg {
    width: 14px;
    height: 14px;
}

.comment-form {
    border-top: 1px solid #efefef;
    padding-top: 16px;
}

.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 8px;
    background: #fafafa;
    resize: vertical;
    min-height: 60px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #ffc2d1;
    background: #ffffff;
}

.comment-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.comment-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.comment-body {
    flex: 1;
}

.comment-text {
    color: #262626;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.comment-timestamp {
    font-size: 11px;
    color: #8e8e8e;
    font-weight: 400;
}

.comment-buttons .btn-secondary,
.comment-buttons .btn-primary {
    padding: 8px 16px;
    font-size: 13px;
}

@media (max-width: 900px) {
    .header {
        padding: 16px 20px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .photo-detail {
        grid-template-columns: 1fr;
        max-height: 90vh;
    }
    
    .photo-detail img {
        max-height: 50vh;
    }
    
    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal-photo {
        margin: 20px;
        border-radius: 12px;
    }
    
    .delete-photo-btn {
        right: 60px;
        width: 36px;
        height: 36px;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fafafa;
}

::-webkit-scrollbar-thumb {
    background: #dbdbdb;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c7c7c7;
}