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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.page {
    display: none;
    min-height: 100vh;
    background-color: #fff;
}

.page.active {
    display: block;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #6c63ff;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
}

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.login-btn, .logout-btn {
    background: none;
    border: 1px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

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

.action-btn, .write-btn {
    background: none;
    border: 1px solid white;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
}

.submit-btn {
    background: #6c63ff;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
}

/* Main Content */
.main-content {
    padding: 20px;
    padding-bottom: 40px;
}

/* Schedule Tabs */
.schedule-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.schedule-tab {
    flex: 1;
    padding: 12px 16px;
    background: #f5f5f5;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.schedule-tab.active {
    background: white;
    color: #6c63ff;
    border-bottom-color: #6c63ff;
    box-shadow: 0 -2px 8px rgba(108, 99, 255, 0.1);
}

.schedule-tab:active {
    transform: translateY(1px);
}

/* Schedule Tab Content */
.schedule-tab-content {
    position: relative;
}

/* Schedule List */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* No Schedules Message */
.no-schedules {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.no-schedules p {
    font-size: 14px;
    margin: 0;
}

.schedule-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #6c63ff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Past schedules in past tab get muted styling */
#past-schedules .schedule-item,
#past-schedules-logged .schedule-item {
    border-left-color: #bdbdbd;
    background: #fafafa;
    opacity: 0.9;
}

#past-schedules .schedule-date,
#past-schedules-logged .schedule-date {
    color: #757575;
}

#past-schedules .schedule-title,
#past-schedules-logged .schedule-title {
    color: #616161;
}

#past-schedules .schedule-time,
#past-schedules .schedule-location,
#past-schedules-logged .schedule-time,
#past-schedules-logged .schedule-location {
    color: #9e9e9e;
}

/* Today's schedules get special highlighting */
.schedule-item[data-is-today="true"] {
    border-left-color: #1976d2;
    box-shadow: 0 2px 12px rgba(25, 118, 210, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.schedule-item[data-is-today="true"] .schedule-date {
    color: #1976d2;
    font-weight: 700;
}

.schedule-item.clickable {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.schedule-item.clickable:active {
    transform: scale(0.98);
}

.schedule-date {
    color: #6c63ff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.schedule-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.schedule-time, .schedule-location {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.participation-status {
    margin-top: 8px;
    padding: 4px 8px;
    background-color: #e8f5e8;
    color: #2d7d32;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.participation-status:contains("미참여") {
    background-color: #fff3e0;
    color: #ef6c00;
}

/* Forms */
.login-form, .signup-form, .post-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 400px;
    margin: 0 auto;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    background-color: #f9f9f9;
    transition: border-color 0.2s ease;
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: #6c63ff;
    background-color: white;
}

.input-group textarea {
    min-height: 200px;
    resize: vertical;
    font-family: inherit;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background-color: #6c63ff;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-btn:active {
    background-color: #5a52d5;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.link-btn {
    background: none;
    border: none;
    color: #6c63ff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}

/* Detail Page */
.detail-info {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-info h2 {
    color: #333;
    margin-bottom: 16px;
    font-size: 20px;
}

.detail-item {
    display: flex;
    margin-bottom: 12px;
}

.detail-item .label {
    font-weight: 600;
    color: #666;
    width: 60px;
    flex-shrink: 0;
}

.participation-section, .participants-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.participation-section h3, .participants-section h3 {
    margin-bottom: 16px;
    color: #333;
    font-size: 16px;
}

.participation-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.participate-btn, .not-participate-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.participate-btn {
    background-color: #4caf50;
    color: white;
}

.participate-btn:active {
    background-color: #45a049;
}

.not-participate-btn {
    background-color: #f44336;
    color: white;
}

.not-participate-btn:active {
    background-color: #da190b;
}

.current-status {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participant {
    background-color: #f5f5f5;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
}

/* Board */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.post-item:active {
    transform: scale(0.98);
}

.post-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.post-meta {
    font-size: 12px;
    color: #999;
}

/* Responsive adjustments */
@media (max-width: 375px) {
    .main-content {
        padding: 15px;
    }
    
    .header {
        padding: 12px 15px;
    }
    
    .schedule-item {
        padding: 14px;
    }
    
    .participation-buttons {
        flex-direction: column;
        gap: 8px;
    }
}

/* Comments Section */
.comments-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comments-section h3 {
    margin-bottom: 16px;
    color: #333;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.participant-only-badge {
    background-color: #6c63ff;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* Comment Form */
.comment-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    font-size: 14px;
    font-family: inherit;
    background-color: #f9f9f9;
    transition: border-color 0.2s ease;
    margin-bottom: 12px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #6c63ff;
    background-color: white;
}

.submit-comment-btn {
    background-color: #6c63ff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-comment-btn:active {
    background-color: #5a52d5;
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.comment-time {
    font-size: 12px;
    color: #999;
}

.comment-content {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

.delete-comment-btn {
    background: none;
    border: 1px solid #f44336;
    color: #f44336;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-comment-btn:active {
    background-color: #f44336;
    color: white;
}

.no-comments {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-comments p {
    font-size: 14px;
    margin: 0;
}

/* Comments visibility states */
.comments-section.hidden {
    display: none !important;
}

.comments-section.show-participants-only {
    display: block;
}

/* Active states for touch devices */
@media (hover: none) {
    .schedule-item.clickable:hover {
        transform: none;
    }
    
    .post-item:hover {
        transform: none;
    }
}

/* Post Detail Page */
.post-detail {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.post-header h2 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-meta {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.post-meta .separator {
    margin: 0 8px;
    color: #ccc;
}

.post-content {
    line-height: 1.7;
    font-size: 15px;
    color: #333;
    word-break: break-word;
}

/* Post Comments Section */
.post-comments-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-comments-section h3 {
    margin-bottom: 16px;
    color: #333;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-count {
    background-color: #6c63ff;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Enhanced post item styling */
.post-item {
    position: relative;
}

.post-item::after {
    content: '>';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 16px;
}

/* Header actions styling */
.header-actions .action-btn {
    background: none;
    border: 1px solid white;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
}

.header-actions .action-btn:active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Mobile specific comment adjustments */
@media (max-width: 375px) {
    .comments-section {
        padding: 16px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .delete-comment-btn {
        align-self: flex-end;
        margin-top: 8px;
    }
    
    .post-detail {
        padding: 16px;
    }
    
    .post-header h2 {
        font-size: 18px;
    }
    
    .post-meta {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .post-meta .separator {
        margin: 0 4px;
    }
    
    .post-comments-section {
        padding: 16px;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .post-item::after {
        right: 12px;
    }
}

/* Quill Editor Customization */
.editor-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

#post-content-editor {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

#post-content-editor:focus-within {
    border-color: #6c63ff;
}

/* Quill toolbar customization */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid #e0e0e0 !important;
    padding: 12px 16px !important;
    background: #f9f9f9;
    border-radius: 12px 12px 0 0;
}

.ql-toolbar.ql-snow .ql-formats {
    margin-right: 12px;
}

.ql-toolbar.ql-snow .ql-picker-label {
    border: none !important;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.ql-toolbar.ql-snow .ql-picker-label:hover,
.ql-toolbar.ql-snow button:hover {
    background-color: rgba(108, 99, 255, 0.1) !important;
}

.ql-toolbar.ql-snow button {
    padding: 4px !important;
    border-radius: 4px !important;
    margin: 0 2px !important;
}

.ql-toolbar.ql-snow button.ql-active {
    background-color: #6c63ff !important;
    color: white !important;
}

/* Quill editor content area */
.ql-container.ql-snow {
    border: none !important;
    font-size: 15px !important;
    border-radius: 0 0 12px 12px;
}

.ql-editor {
    min-height: 200px !important;
    padding: 16px !important;
    line-height: 1.6 !important;
    color: #333 !important;
}

.ql-editor.ql-blank::before {
    color: #999 !important;
    font-style: normal !important;
    content: "내용을 입력하세요..." !important;
}

/* Mobile optimization for editor */
@media (max-width: 375px) {
    .ql-toolbar.ql-snow {
        padding: 8px 12px !important;
    }
    
    .ql-toolbar.ql-snow .ql-formats {
        margin-right: 8px;
    }
    
    .ql-toolbar.ql-snow button {
        padding: 3px !important;
        margin: 0 1px !important;
    }
    
    .ql-editor {
        min-height: 150px !important;
        padding: 12px !important;
        font-size: 14px !important;
    }
    
    /* Hide some toolbar items on mobile for better space */
    .ql-toolbar.ql-snow .ql-header[value="1"],
    .ql-toolbar.ql-snow .ql-header[value="2"] {
        display: none;
    }
}

/* Focus states */
.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {
    background-color: rgba(108, 99, 255, 0.1) !important;
}

.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    background: white !important;
}

/* Ensure editor content displays properly in detail view */
.post-content .ql-editor {
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.post-content .ql-editor p {
    margin-bottom: 12px;
}

.post-content .ql-editor h1,
.post-content .ql-editor h2,
.post-content .ql-editor h3 {
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.post-content .ql-editor ul,
.post-content .ql-editor ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.post-content .ql-editor blockquote {
    border-left: 4px solid #6c63ff;
    padding-left: 12px;
    margin: 12px 0;
    color: #666;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 0 8px 8px 0;
}

.post-content .ql-editor strong {
    font-weight: 600;
}

.post-content .ql-editor em {
    font-style: italic;
}

/* Map Links */
.schedule-location {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.location-text {
    flex: 1;
}

.map-link {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 18px;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.map-link:hover {
    background-color: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.5);
    transform: scale(1.05);
}

.map-link:active {
    transform: scale(0.95);
    background-color: #ff6b6b;
    color: white;
}

.detail-map-link {
    margin-left: 8px;
}

/* Map Modal */
.map-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.map-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
}

.map-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.map-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.map-modal-close:hover {
    background-color: #f0f0f0;
    color: #666;
}

.map-modal-body {
    padding: 20px;
}

#map-location-text {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.map-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.map-option-btn:hover {
    border-color: #6c63ff;
    background-color: #f8f7ff;
}

.map-option-btn:active {
    transform: scale(0.98);
    background-color: #6c63ff;
    color: white;
}

.map-icon {
    font-size: 18px;
    font-weight: bold;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* 네이버 지도 아이콘 */
.map-option-btn:nth-child(1) .map-icon {
    background-color: #03c75a;
}

/* 카카오맵 아이콘 */
.map-option-btn:nth-child(2) .map-icon {
    background-color: #fee500;
    color: #3c1e1e;
}

/* Mobile optimizations for map features and tabs */
@media (max-width: 375px) {
    .schedule-location {
        gap: 6px;
    }
    
    .map-link {
        font-size: 16px;
        padding: 5px;
        background-color: rgba(255, 107, 107, 0.15);
        border: 1px solid rgba(255, 107, 107, 0.4);
    }
    
    .map-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .map-modal-header {
        padding: 16px 16px 0 16px;
    }
    
    .map-modal-body {
        padding: 16px;
    }
    
    .map-option-btn {
        padding: 14px;
        font-size: 15px;
    }
    
    .map-icon {
        font-size: 16px;
        width: 26px;
        height: 26px;
    }
    
    /* Tab optimizations for mobile */
    .schedule-tabs {
        margin-bottom: 15px;
    }
    
    .schedule-tab {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .no-schedules {
        padding: 30px 15px;
    }
    
    .schedule-list {
        gap: 12px;
    }
}