/* 피드 작성 모달 - X(트위터) 스타일 */

/* 모달 오버레이 */
.feed-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    animation: fadeIn 0.2s ease;
    align-items: center;
    justify-content: center;
}

.feed-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    overflow-y: auto;
}

/* 모달 컨텐츠 */
.feed-modal-content {
    background: #22313F;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: auto;
    position: relative;
}

/* 모달 헤더 */
.feed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feed-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #e2fdf7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.feed-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.feed-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #fefad4;
    margin: 0;
    flex: 1;
    text-align: center;
}

.feed-submit-btn {
    padding: 8px 20px;
    background: #F64747;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.feed-submit-btn:hover:not(:disabled) {
    background: #da3838;
    transform: translateY(-1px);
}

.feed-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 모달 바디 */
.feed-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 피드 작성 영역 */
.feed-write-area {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.feed-user-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.feed-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.feed-write-content {
    flex: 1;
}

.feed-write-content textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #e2fdf7;
    font-size: 18px;
    line-height: 1.5;
    resize: none;
    outline: none;
    font-family: inherit;
}

.feed-write-content textarea::placeholder {
    color: rgba(226, 253, 247, 0.5);
}

.feed-char-counter {
    text-align: right;
    font-size: 13px;
    color: rgba(226, 253, 247, 0.5);
    margin-top: 8px;
}

.feed-char-counter.warning {
    color: #F64747;
}

/* 미디어 미리보기 */
.feed-media-preview {
    margin: 20px 0;
    display: none;
}

.feed-media-preview.active {
    display: block;
}

.media-preview-grid {
    display: grid;
    gap: 8px;
    border-radius: 12px;
    overflow: hidden;
}

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

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

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

.media-preview-grid.triple .media-item:first-child {
    grid-column: span 2;
}

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

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

.media-preview-grid.five .media-item:nth-child(4),
.media-preview-grid.five .media-item:nth-child(5) {
    grid-column: span 1;
}

/* 미디어 프리뷰 컨테이너 - 높이 제한 */
.feed-media-preview {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 10px 0;
    padding: 5px;
    position: relative;
}

.feed-media-preview::-webkit-scrollbar {
    width: 6px;
}

.feed-media-preview::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.feed-media-preview::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.feed-media-preview::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 수정 모드용 미디어 그리드 */
.media-grid {
    display: block;  /* flex 대신 block으로 변경 (Sortable 호환성) */
    margin-top: 10px;
    padding: 2px;
}

.media-video {
    position: relative;
    margin-top: 10px;
}

.media-video video {
    width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

/* 업로드 로딩 스타일 */
.media-item.media-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(246, 71, 71, 0.05) 100%);
    min-height: 100px;
    position: relative;
    overflow: hidden;
}

.media-item.media-loading::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #F64747, #22313F, #F64747, #22313F);
    background-size: 400% 400%;
    animation: borderGradient 3s ease infinite;
    border-radius: 8px;
    z-index: -1;
}

@keyframes borderGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.upload-progress {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #F64747;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 10px;
}

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

.progress-text {
    color: #e2fdf7;
    font-size: 13px;
    margin-top: 10px;
    font-weight: 600;
}

.progress-subtext {
    color: rgba(226, 253, 247, 0.7);
    font-size: 11px;
    margin-top: 5px;
}

.progress-warning {
    color: #fefad4;
    font-size: 10px;
    margin-top: 5px;
    font-style: italic;
}

/* 비디오 로딩 특별 스타일 */
.media-item.video-loading {
    background: linear-gradient(45deg, rgba(246, 71, 71, 0.1), rgba(52, 73, 94, 0.3));
}

.media-item.video-loading .spinner {
    border-top-color: #fefad4;
    animation: spin 0.8s ease-in-out infinite;
}

.media-item {
    position: relative;
    background: #34495E;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1/1;
    width: 60px;
    height: 60px;
    cursor: move;
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
    vertical-align: top;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-remove,
.remove-media,
.media-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
    z-index: 10;
    opacity: 0;
}

.media-item:hover .media-remove,
.media-item:hover .remove-media,
.media-item:hover .remove-btn {
    opacity: 1;
}

.media-remove:hover,
.remove-media:hover,
.media-item .remove-btn:hover {
    background: #F64747;
    transform: scale(1.1);
}

/* 이미지 업로드 로딩 스타일 */
.media-item.loading {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

.upload-progress {
    text-align: center;
    padding: 5px;
}

.upload-spinner {
    width: 20px;
    height: 20px;
    margin: 0 auto 5px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #F64747;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 워터마크 뱃지 */
.watermark-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 8px;
    font-weight: bold;
    z-index: 10;
}

.upload-text {
    color: #ecf0f1;
    font-size: 9px;
    margin-bottom: 2px;
}

.feed-upload-progress-bar {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.feed-upload-progress-fill {
    height: 100%;
    background: #F64747;
    width: 0;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* 워터마크 뱃지 */
.watermark-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* 이미지 로드 완료 애니메이션 */
.media-item.loaded {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 피드 옵션 */
.feed-write-options {
    background: rgba(52, 73, 94, 0.3);
    border-radius: 12px;
    padding: 12px;
    margin: 15px 0;
}

.feed-option-row {
    margin-bottom: 12px;
}

.feed-option-row:last-child {
    margin-bottom: 0;
}

.feed-option-label {
    display: inline-block;
    font-size: 12px;
    color: #fefad4;
    margin-bottom: 6px;
    font-weight: 500;
}

/* 버튼 그룹 스타일 */
.feed-button-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.feed-button-group .feed-option-label {
    min-width: 35px;
    margin-bottom: 0;
}

.button-group-inline {
    display: flex;
    gap: 4px;
}

.button-group-inline input[type="radio"] {
    display: none;
}

.button-option {
    padding: 5px 10px;
    background: rgba(52, 73, 94, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(226, 253, 247, 0.7);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 28px;
    justify-content: center;
    white-space: nowrap;
}

.button-option:hover {
    background: rgba(52, 73, 94, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

.button-group-inline input[type="radio"]:checked + .button-option {
    border: 1px dashed #F64747;
    color: white;
    font-weight: 500;
}

/* 컴팩트 옵션 레이아웃 */
.feed-option-compact {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.feed-option-group {
    flex: 1;
    min-width: 0;
}

.feed-select-compact {
    width: 100%;
    padding: 6px 10px;
    background: #34495E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e2fdf7;
    font-size: 13px;
    outline: none;
}

.feed-input-compact {
    width: 100%;
    padding: 6px 10px;
    background: #34495E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e2fdf7;
    font-size: 13px;
    outline: none;
}

.feed-select-compact:focus,
.feed-input-compact:focus {
    border-color: #F64747;
}

.feed-type-select,
.feed-access-select {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.feed-type-radio,
.feed-access-radio {
    position: relative;
}

.feed-type-radio input,
.feed-access-radio input {
    position: absolute;
    opacity: 0;
}

.feed-type-radio span,
.feed-access-radio span {
    display: inline-block;
    padding: 6px 12px;
    background: #34495E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 13px;
    color: rgba(226, 253, 247, 0.7);
    cursor: pointer;
    transition: all 0.2s;
}

.feed-type-radio input:checked + span,
.feed-access-radio input:checked + span {
    background: #F64747;
    border-color: #F64747;
    color: white;
}

.feed-select,
.feed-input {
    width: 100%;
    padding: 8px 12px;
    background: #34495E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e2fdf7;
    font-size: 14px;
    outline: none;
}

.feed-select:focus,
.feed-input:focus {
    border-color: #F64747;
}

/* 미디어 미리보기 영역 */
.feed-media-preview {
    margin: 15px 0;
    display: none;
}

.feed-media-preview.active {
    display: block;
}

/* 미디어 프리뷰 그리드 - #mediaPreview */
#mediaPreview {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 1줄에 3개씩 */
    gap: 8px;
    padding: 8px;
    background: rgba(34, 49, 63, 0.3);
    border-radius: 12px;
}

/* 수정 모드에서 media-grid 래퍼가 있는 경우 */
#mediaPreview .media-grid {
    display: contents; /* 래퍼 div를 투명하게 처리 */
}

/* 반응형 - 작은 화면에서는 2개씩 */
@media (max-width: 768px) {
    #mediaPreview {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 미디어 아이템 */
.media-item {
    position: relative;
    background: #2C3E50;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1; /* 정사각형 비율 */
    min-height: 120px; /* 최소 높이 감소 */
    max-height: 180px; /* 최대 높이 제한 */
    width: 100%; /* 가로 100%로 설정 */
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 비디오 스타일 개별 처리 */
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
    position: relative;
    z-index: 1;
}

/* 비디오 컨트롤 스타일 초기화 */
.feed-media-preview video::-webkit-media-controls-enclosure {
    z-index: 2;
}

.feed-media-preview video::-webkit-media-controls-panel {
    z-index: 2;
}

/* 중복 플레이 버튼이나 오버레이 제거 */
.media-item::before,
.media-item::after {
    display: none !important;
}

.media-item .video-overlay,
.media-item .video-play-overlay,
.media-item .play-button-overlay,
.media-item .play-icon {
    display: none !important;
}

/* 비디오 포스터 이미지 스타일 */
.media-item video[poster] {
    object-fit: cover;
}

/* 제거 버튼 */
.media-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.media-remove:hover {
    background: #F64747;
    transform: scale(1.1);
}

/* 비디오 스타일 */
.media-item video {
    background: #000;
}

/* 태그 입력 섹션 */
.feed-tags-section {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(34, 49, 63, 0.3);
}

.tags-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-height: 44px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(34, 49, 63, 0.8);
    border: 1px solid rgba(52, 73, 94, 0.5);
    border-radius: 20px;
    padding: 5px 8px 5px 14px;
    gap: 8px;
    animation: fadeIn 0.2s;
    transition: all 0.2s ease;
}

.tag-chip:hover {
    background: rgba(52, 73, 94, 0.6);
    border-color: rgba(246, 71, 71, 0.4);
}

.tag-text {
    color: #fefad4;
    font-size: 13px;
    font-weight: 500;
}

.tag-remove {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    font-weight: 300;
}

.tag-remove:hover {
    background: rgba(246, 71, 71, 0.3);
    border-color: rgba(246, 71, 71, 0.5);
    color: #f64747;
    transform: scale(1.1);
}

.tag-input {
    flex: 1;
    min-width: 120px;
    background: transparent;
    border: none;
    color: #e2fdf7;
    font-size: 14px;
    outline: none;
    padding: 4px;
}

.tag-input::placeholder {
    color: rgba(226, 253, 247, 0.4);
}

.tags-hint {
    margin-top: 8px;
    padding: 0 10px;
}

.hint-text {
    font-size: 12px;
    color: rgba(254, 250, 212, 0.6);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 툴바 */
.feed-toolbar {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.toolbar-label {
    font-size: 12px;
    color: #fefad4;
    font-weight: 500;
    margin-bottom: 10px;
}

.media-buttons {
    display: flex;
    gap: 10px;
}

.media-upload-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(52, 73, 94, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e2fdf7;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.media-upload-btn:hover {
    background: rgba(52, 73, 94, 0.5);
    border-color: #F64747;
    transform: translateY(-1px);
}

.media-upload-btn:active {
    transform: translateY(0);
}

.media-icon {
    font-size: 16px;
    display: inline-flex;
}

.media-title {
    font-size: 12px;
    font-weight: 600;
    color: #fefad4;
}

.media-desc {
    font-size: 10px;
    color: rgba(226, 253, 247, 0.5);
}

/* 업로드 버튼 호버 효과 */
.media-upload-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(246, 71, 71, 0.1), transparent);
    transition: left 0.5s;
}

.media-upload-btn:hover::before {
    left: 100%;
}

/* 비디오 업로드 로딩 */
.video-upload-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin: 10px;
}

.upload-progress {
    text-align: center;
    padding: 20px;
}

.upload-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #F64747;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.upload-text {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.upload-subtext {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* 워터마크 뱃지 */
.watermark-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(34, 49, 63, 0.9);
    color: #4CAF50;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    z-index: 2;
    pointer-events: none;
}

/* 이미지 업로드 로딩 상태 */
.media-item.loading {
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.media-item.loading .upload-progress {
    padding: 10px;
}

.media-item.loading .upload-spinner {
    width: 30px;
    height: 30px;
    margin-bottom: 10px;
}

.media-item.loading .upload-text {
    font-size: 12px;
}

/* 미디어 아이템 로드 완료 애니메이션 */
.media-item.loaded {
    animation: fadeIn 0.3s ease;
}

/* 비디오 컨테이너 */
.media-video {
    width: 100%;
    padding: 10px;
}

.media-video .media-item {
    position: relative;
    width: 100%;
}

.media-video video {
    width: 100%;
    height: auto;
    max-height: 400px;
    border-radius: 8px;
    background: #000;
}

/* 워터마킹 로딩 스타일 */
.media-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 150px; /* 최소 높이를 media-item과 동일하게 */
    background: linear-gradient(135deg, rgba(34, 49, 63, 0.98) 0%, rgba(44, 62, 80, 0.98) 100%);
    border-radius: 8px;
    padding: 15px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.media-loading .loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(246, 71, 71, 0.2);
    border-top-color: #F64747;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.media-loading > span {
    color: #F64747;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    text-align: center;
    display: block;
    width: 100%;
}

.media-loading .loading-progress {
    color: rgba(226, 253, 247, 0.9);
    font-size: 11px;
    text-align: center;
    line-height: 1.3;
    animation: pulse 2s ease-in-out infinite;
    display: block;
    width: 100%;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* 자동 삭제 설정 */
.feed-option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.feed-delete-setting {
    margin-top: 10px;
}

.feed-delete-quick {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* 토글 스위치 스타일 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #F64747;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.quick-btn {
    padding: 4px 10px;
    background: #34495E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: rgba(226, 253, 247, 0.7);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: #F64747;
    border-color: #F64747;
    color: white;
}

/* Datepicker 커스텀 스타일 */
.datepicker {
    background: #22313F !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2fdf7 !important;
    z-index: 10001 !important; /* 모달보다 위에 표시 */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

.datepickers-container {
    z-index: 10001 !important;
}

/* Datepicker가 화면 밖으로 나가지 않도록 */
.datepicker--pointer {
    display: none !important; /* 화살표 숨기기 */
}

.datepicker--nav {
    background: #2C3E50 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.datepicker--nav-title {
    color: #fefad4 !important;
}

.datepicker--day {
    color: #e2fdf7 !important;
}

.datepicker--day:hover {
    background: #34495E !important;
}

.datepicker--day.-selected- {
    background: #F64747 !important;
}


/* 모바일 반응형 */
@media (max-width: 640px) {
    .feed-modal.active {
        padding: 0;
        align-items: flex-end;
    }
    
    .feed-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }
    
    .feed-write-content textarea {
        font-size: 16px;
    }
    
    .feed-modal-title {
        font-size: 18px;
    }
    
    .feed-option-compact {
        flex-direction: column;
    }
    
    .feed-option-group {
        width: 100% !important;
    }
    
    .quick-btn {
        flex: 1;
        min-width: 60px;
    }
    
    /* 모바일에서 버튼 그룹 조정 */
    .feed-button-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .feed-button-group .feed-option-label {
        margin-bottom: 4px;
    }
    
    .button-option {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    /* 모바일에서 미디어 버튼 */
    .media-buttons {
        gap: 8px;
    }
}

/* 로딩 스피너 */
.feed-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 펄스 애니메이션 (스토리 영상 필수 강조용) */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(246, 71, 71, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(246, 71, 71, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(246, 71, 71, 0);
    }
}

/* 에러 메시지 */
.feed-error {
    background: rgba(246, 71, 71, 0.1);
    border: 1px solid #F64747;
    color: #F64747;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin: 16px 0;
}

/* 성공 메시지 */
.feed-success {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid #4ECDC4;
    color: #4ECDC4;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin: 16px 0;
}

/* 모바일 작성 버튼 스타일 */
.mobile-write-btn {
    background: #F64747;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.mobile-write-btn:hover {
    background: #da3838;
    transform: translateY(-1px);
}

/* Sortable.js 드래그 앤 드롭 스타일 */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;
}

/* 드래그 가능한 아이템 커서 */
.media-item {
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.media-item:active {
    cursor: grabbing;
}

/* 드래그 중인 아이템 */
.sortable-drag {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(246, 71, 71, 0.3);
    z-index: 1000;
}

/* 드래그 중 고스트 이미지 */
.sortable-ghost {
    opacity: 0.4;
    background: rgba(246, 71, 71, 0.1);
    border: 2px dashed #F64747;
    border-radius: 8px;
}

/* 드래그 가능 아이템 호버 */
.media-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 드래그 중 다른 아이템들 */
.media-grid.sortable-active .media-item:not(.sortable-drag) {
    opacity: 0.7;
}

/* 드래그 인디케이터 (드래그 핸들) */
.media-item::before {
    content: '⋮⋮';
    position: absolute;
    top: 8px;
    left: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-item:hover::before {
    opacity: 1;
}

/* 순서 번호 표시 (옵션) */
.media-item[data-sort-order]::after {
    content: attr(data-sort-order);
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(246, 71, 71, 0.9);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-grid:hover .media-item[data-sort-order]::after {
    opacity: 1;
}

/* 드롭 영역 강조 */
.media-grid.sortable-chosen {
    background: rgba(246, 71, 71, 0.05);
}

/* 모바일 최적화 */
@media (max-width: 640px) {
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }
    
    .media-item::before {
        opacity: 1; /* 모바일에서는 항상 표시 */
    }
}
/* Sortable 드래그 앤 드롭 스타일 */
.sortable-ghost {
    opacity: 0.4;
    background: rgba(246, 71, 71, 0.1);
    border: 2px dashed #F64747;
    border-radius: 8px;
}

.sortable-drag {
    opacity: 0.9 !important;
    transform: rotate(2deg) scale(1.05);
    box-shadow: 0 10px 30px rgba(246, 71, 71, 0.3);
    z-index: 10000;
}

.sortable-chosen {
    opacity: 0.8;
    transform: scale(1.02);
}

.media-item {
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.media-item:active {
    cursor: grabbing;
}

.media-item:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 드래그 중 다른 요소들 */
body.dragging * {
    cursor: grabbing !important;
}

/* 드래그 가능 표시기 - 삭제됨 (드래그 전체 영역 가능) */

/* Sortable 드래그 중 스타일 */
.sortable-ghost {
    opacity: 0.4 !important;
    background: #34495E !important;
    border: 2px dashed #F64747 !important;
}

.sortable-drag {
    opacity: 0.9 !important;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 10000 !important;
    cursor: grabbing !important;
}

.sortable-chosen {
    opacity: 0.8;
    cursor: grabbing !important;
}

/* 드래그 가능 영역 내 다른 요소들의 pointer-events 비활성화 */
.feed-media-preview.sortable-active .media-remove,
.feed-media-preview.sortable-active .remove-media,
.feed-media-preview.sortable-active .remove-btn {
    pointer-events: none !important;
}
