/* ============================================
   중고매물등록 페이지 스타일
   CSS 변수는 variables.css에서 정의
   ============================================ */

.register-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 300px);
    background-color: var(--bg-primary, #fff);
    padding: var(--space-10, 40px) var(--space-5, 20px);
}

.register-container {
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.register-title {
    font-family: var(--font-family-base, 'Pretendard', sans-serif);
    font-size: var(--font-size-4xl, 42px);
    font-weight: var(--font-weight-extrabold, 800);
    color: var(--text-primary, #1a1a1a);
    margin-bottom: var(--space-16, 60px);
    letter-spacing: var(--letter-spacing-tight, -0.02em);
    word-break: keep-all;
    line-height: var(--line-height-tight, 1.3);
}

.register-form-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.car-register-form {
    width: 100%;
    max-width: 700px;
}

.input-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-primary, #fff);
    border: 2px solid var(--text-primary, #1a1a1a);
    border-radius: var(--radius-xl, 16px);
    padding: var(--space-2, 8px) var(--space-2, 8px) var(--space-2, 8px) var(--space-5, 20px);
    box-shadow: var(--shadow-sm, 0 4px 20px rgba(0, 0, 0, 0.05));
    transition: all var(--transition-base, 0.3s ease);
}

.input-container:focus-within {
    box-shadow: var(--shadow-lg, 0 8px 30px rgba(0, 0, 0, 0.12));
    transform: translateY(-2px);
    border-color: var(--color-primary, #667eea);
}

.input-field {
    border: none;
    background: transparent;
    font-family: var(--font-family-base, 'Pretendard', sans-serif);
    font-size: var(--font-size-2xl, 24px);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-primary, #1a1a1a);
    padding: var(--space-4, 15px) var(--space-3, 10px);
    outline: none;
}

.input-field::placeholder {
    color: var(--text-disabled, #cccccc);
    font-weight: var(--font-weight-medium, 500);
}

.name-field {
    width: 100px;
    text-align: center;
}

.car-number-field {
    flex: 1;
    text-align: left;
    padding-left: 15px;
}

.divider {
    font-size: 28px;
    color: #e0e0e0;
    margin: 0 5px;
    font-weight: 300;
    padding-bottom: 4px; /* 수직 정렬 미세 조정 */
}

.btn-submit {
    background: var(--gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: var(--text-inverse, #ffffff);
    border: none;
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-4, 16px) var(--space-10, 40px);
    font-family: var(--font-family-base, 'Pretendard', sans-serif);
    font-size: var(--font-size-xl, 20px);
    font-weight: var(--font-weight-bold, 700);
    cursor: pointer;
    transition: all var(--transition-fast, 0.2s ease);
    white-space: nowrap;
    margin-left: var(--space-3, 10px);
    box-shadow: var(--shadow-primary, 0 4px 15px rgba(102, 126, 234, 0.3));
}

.btn-submit:hover {
    box-shadow: var(--shadow-primary-lg, 0 8px 25px rgba(102, 126, 234, 0.4));
    transform: translateY(-2px);
}

/* ============================================
   로딩 스피너
   ============================================ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
    gap: 15px;
}

.loading-spinner i {
    font-size: 32px;
    color: #ff4747;
}

/* ============================================
   차량 정보 결과 모달 컨테이너
   ============================================ */
.vehicle-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    padding: 24px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
}

.vehicle-result-modal {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
    padding: 24px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.vehicle-result-close {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* 기본 정보 카드 - 브랜드 컬러(보라+네이비) */
.result-card {
    background: #f5f6f8;
    border-radius: 16px;
    padding: 24px;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.result-card-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.badge-primary {
    background-color: #fdecef;
    color: #1a1a1a;
}

.badge-secondary {
    background-color: #e5e7eb;
    color: #111;
}

.badge-info {
    background-color: #dfe4f2;
    color: #111;
}

/* 정보 섹션 */
.result-section {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #5e72e4;
}

/* 정보 그리드 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.info-value {
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 600;
}

/* 캐시 히트 배지 */
.cache-hit-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background-color: #e8f5e9;
    color: #2e7d32;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* 등록 버튼 */
.result-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-register {
    width: 100%;
    padding: 18px;
    background-color: #ff4747;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-register:hover {
    background-color: #ff2e2e;
}

.btn-close-modal {
    width: 100%;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background-color: #f8f8f8;
    font-size: 16px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-close-modal:hover {
    background-color: #ececec;
    color: #111;
}

/* 타이어 리스트 */
.tire-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tire-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #e6e8ec;
}

.tire-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #5e72e4;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.tire-spec {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 600;
}

/* 원본 응답 영역 */
.raw-response-block {
    max-height: 240px;
    overflow: auto;
    background-color: #0f172a;
    color: #cbd5f5;
    padding: 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.raw-response-block::-webkit-scrollbar {
    width: 8px;
}

.raw-response-block::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

/* ============================================
   에러 메시지
   ============================================ */
.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    margin-top: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.error-message i {
    font-size: 20px;
}

/* ============================================
   로그인 필요 안내
   ============================================ */
.login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    background-color: #f5f5f5;
    border-radius: 16px;
    margin-top: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.login-required i {
    font-size: 48px;
    color: #999;
}

.login-required p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.btn-login {
    padding: 14px 40px;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-login:hover {
    background-color: #333;
}

/* ============================================
   모바일 반응형
   ============================================ */
/* ============================================
   풀스크린 등록 모달
   ============================================ */
.listing-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.listing-modal-fullscreen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
    overflow: hidden;
}

/* 모달 헤더 */
.listing-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background-color: #fff;
    border-bottom: 1px solid #e6e8ec;
    flex-shrink: 0;
}

.listing-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.btn-modal-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    font-size: 20px;
    transition: all 0.2s ease;
}

.btn-modal-close:hover {
    background-color: #f0f0f0;
    color: #1a1a1a;
}

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

/* 차량 정보 요약 */
.listing-vehicle-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background-color: #fff;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.vehicle-thumb-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #5e72e4 0%, #3d2c8d 100%);
    border-radius: 12px;
    color: #fff;
    font-size: 32px;
}

.vehicle-summary-info {
    flex: 1;
}

.vehicle-name {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px 0;
}

.vehicle-meta {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 내차량 정보조회 버튼 */
.btn-view-vehicle-info {
    padding: 12px 16px;
    background-color: #f5f7fa;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #5e72e4;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-view-vehicle-info:hover {
    background-color: #5e72e4;
    border-color: #5e72e4;
    color: #fff;
}

/* 차량 정보 모달 오버레이 (등록 모달 위에 표시) */
.vehicle-modal-overlay {
    z-index: 10001 !important;
}

/* 판매 유형 탭 */
.sale-type-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 16px 20px;
    background-color: #fff;
    border: 2px solid #e6e8ec;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    border-color: #5e72e4;
    color: #5e72e4;
}

.tab-btn.active {
    background-color: #5e72e4;
    border-color: #5e72e4;
    color: #fff;
}

.tab-btn i {
    font-size: 18px;
}

/* 등록 폼 */
.listing-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section {
    background-color: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    color: #5e72e4;
}

.form-section-title .required {
    color: #ff4747;
}

.form-section-title .photo-count {
    font-size: 14px;
    font-weight: 500;
    color: #888;
    margin-left: 4px;
}

.form-help-text {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.form-group label .required {
    color: #ff4747;
    margin-left: 2px;
}

.form-group input,
.form-group textarea {
    padding: 14px 16px;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Pretendard', sans-serif;
    color: #1a1a1a;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5e72e4;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #bbb;
}

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

.input-with-unit {
    display: flex;
    align-items: center;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.input-with-unit:focus-within {
    border-color: #5e72e4;
}

.input-with-unit input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 15px;
    font-family: 'Pretendard', sans-serif;
    color: #1a1a1a;
}

.input-with-unit input:focus {
    outline: none;
}

.input-with-unit .unit {
    padding: 14px 16px;
    background-color: #f5f7fa;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* 사진 업로드 영역 */
.photo-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    min-height: 50px;
}

.photo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e6e8ec;
    transition: all 0.2s ease;
}

.photo-item:first-child {
    border-color: #5e72e4;
    background-color: #f0f3ff;
}

.photo-item:first-child .thumbnail-badge {
    display: inline-block !important;
}

.photo-drag-handle {
    color: #999;
    cursor: grab;
    padding: 4px;
}

.photo-drag-handle:active {
    cursor: grabbing;
}

.photo-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #e6e8ec;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-size {
    font-size: 13px;
    color: #888;
}

.btn-photo-delete {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-photo-delete:hover {
    background-color: #ffebee;
    color: #c62828;
}

.thumbnail-badge {
    padding: 4px 10px;
    background-color: #5e72e4;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.btn-add-photo {
    width: 100%;
    padding: 14px;
    background-color: #f5f7fa;
    border: 2px dashed #d0d5dd;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-add-photo:hover {
    border-color: #5e72e4;
    color: #5e72e4;
    background-color: #f0f3ff;
}

/* SortableJS 스타일 */
.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    background-color: #f0f3ff !important;
}

.sortable-drag {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 기간 설정 */
.period-options {
    display: flex;
    gap: 16px;
}

.period-option {
    flex: 1;
    cursor: pointer;
}

.period-option input[type="radio"] {
    display: none;
}

.period-card {
    padding: 24px 20px;
    background-color: #f8f9fa;
    border: 2px solid #e6e8ec;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.period-option input:checked + .period-card {
    background-color: #f0f3ff;
    border-color: #5e72e4;
}

.period-days {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.period-desc {
    font-size: 14px;
    color: #888;
}

.period-option input:checked + .period-card .period-days {
    color: #5e72e4;
}

/* 모달 푸터 */
.listing-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background-color: #fff;
    border-top: 1px solid #e6e8ec;
    flex-shrink: 0;
}

.btn-draft {
    flex: 1;
    padding: 16px 24px;
    background-color: #f5f7fa;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-draft:hover {
    background-color: #e6e8ec;
}

.btn-submit-listing {
    flex: 2;
    padding: 16px 24px;
    background-color: #5e72e4;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-submit-listing:hover {
    background-color: #4c5fd7;
}

.btn-submit-listing:disabled,
.btn-draft:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   모바일 반응형
   ============================================ */
@media (max-width: 768px) {
    .register-title {
        font-size: 28px;
        margin-bottom: 40px;
    }

    .input-container {
        padding: 6px 6px 6px 15px;
        border-radius: 12px;
    }

    .input-field {
        font-size: 18px;
        padding: 10px 5px;
    }

    .name-field {
        width: 70px;
    }
    
    .divider {
        font-size: 20px;
    }

    .btn-submit {
        padding: 12px 24px;
        font-size: 16px;
        border-radius: 8px;
    }

    /* 결과 영역 모바일 */
    .result-card {
        padding: 20px;
    }

    .result-card-title {
        font-size: 22px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .result-section {
        padding: 16px;
    }

    /* 등록 모달 모바일 */
    .listing-modal-body {
        padding: 16px;
    }

    .listing-vehicle-summary {
        padding: 16px;
    }

    .vehicle-thumb-placeholder {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .vehicle-name {
        font-size: 18px;
    }

    .sale-type-tabs {
        gap: 8px;
    }

    .tab-btn {
        padding: 14px 12px;
        font-size: 14px;
    }

    .form-section {
        padding: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .period-card {
        padding: 20px 16px;
    }

    .period-days {
        font-size: 24px;
    }

    .listing-modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    .btn-draft,
    .btn-submit-listing {
        flex: none;
        width: 100%;
    }
}
