@charset "utf-8";

/* 주소록 게시판 스타일 */
.rb_bbs_wrap.address-book {
    position: relative;
    margin-top: 0px;
}

/* 주소록 헤더 */
.address-book .address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.address-book .address-header h2 {
    font-size: 24px;
    font-weight: normal;
    color: #000;
    margin: 0;
    font-family: 'font-R', sans-serif;
}

.address-book .admin-menu .btn-admin {
    background-color: #AA20FF;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: normal;
    border: none;
    display: inline-block;
    line-height: normal;
}

.address-book .admin-menu .btn-admin:hover {
    opacity: 0.8;
}

/* 주소록 테이블 */
.address-book .address-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.address-book .address-table thead {
    background-color: #f9f9f9;
}

.address-book .address-table th {
    padding: 20px 15px;
    text-align: center;
    font-family: 'font-B', sans-serif;
    font-weight: normal;
    border-bottom: 1px solid #ddd;
    color: #000;
}

.address-book .address-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    word-break: break-all;
}

.address-book .address-table .cell-order {
    width: 5%;
    text-align: center;
    font-weight: bold;
    color: #AA20FF;
}

.address-book .address-table .cell-region {
    width: 10%;
    text-align: center;
    font-weight: 700;
    color: #000000;
}

.address-book .address-table .cell-office {
    width: 12%;
    text-align: center;
}

.address-book .address-table .cell-manager {
    width: 12%;
    text-align: center;
}

.address-book .address-table .cell-email {
    width: 18%;
    text-align: center;
}

.address-book .address-table .cell-address {
    width: 33%;
    text-align: center;
    padding-left: 20px;
}

.address-book .address-table .cell-actions {
    width: 10%;
    text-align: center;
}

/* 주소 정보 스타일 - 한 줄로 표시 */
.address-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.postal-code {
    color: #888;
    margin-right: 0px;
}

.full-address {
    color: #666;
}

.detail-address {
    color: #666;
    font-size: 14px;
}

/* 구분자 스타일 */
.address-separator {
    color: #ccc;
    margin: 0 3px;
}

/* 관리자 액션 버튼 - 작게 오른쪽 정렬 */
.address-book .admin-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}

.address-book .btn-edit, 
.address-book .btn-delete {
    padding: 6px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    border: none;
    cursor: pointer;
    display: inline-block;
    line-height: normal;
    font-weight: normal;
    min-width: 45px;
}

.address-book .btn-edit {
    background-color: #3498db;
    color: white;
    border: 1px solid #3498db;
}

.address-book .btn-edit:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.address-book .btn-delete {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #e74c3c;
}

.address-book .btn-delete:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

/* 순서 입력 필드 */
.order-input {
    width: 40px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
}

.update-order-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.update-order-btn:hover {
    background-color: #219653;
}

/* 빈 목록 스타일 */
.address-book .address-row.empty {
    text-align: center;
    padding: 50px 20px;
    color: #777;
    font-style: italic;
}

/* 페이지네이션 */
.address-book .pagination {
    margin: 20px 0;
    text-align: center;
}

.address-book .pagination a, 
.address-book .pagination strong {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background-color: #fff;
}

.address-book .pagination a:hover {
    background-color: #f5f5f5;
    border-color: #AA20FF;
    color: #AA20FF;
}

.address-book .pagination strong {
    background-color: #AA20FF;
    color: white;
    border-color: #AA20FF;
}

/* 반응형 디자인 */
@media all and (max-width: 1024px) {
    .address-book .address-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .address-book .address-table th,
    .address-book .address-table td {
        min-width: 100px;
        white-space: nowrap;
    }
    
    .address-book .address-table .cell-address {
        min-width: 250px;
        white-space: normal;
    }
    
    .address-book .address-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .address-book .admin-menu {
        align-self: flex-end;
    }
    
    .address-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    
    .address-separator {
        display: none;
    }
}

/* 주소록 쓰기 페이지 스타일 */
.address-book .rb_inp_wrap {
    margin-bottom: 20px;
}

.address-book .help_text {
    font-size: 12px;
    color: #999;
    display: block;
    margin-bottom: 10px;
    word-break: keep-all;
}

.address-book .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.address-book .form-label .required {
    color: #e74c3c;
}

.address-book .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: #fff;
}

.address-book .form-control:read-only {
    background-color: #f9f9f9;
}

.address-book .form-control:focus {
    border-color: #AA20FF;
    outline: none;
}

/* 우편번호 검색 버튼 */
.address-book .postcode-wrapper {
    display: flex;
    gap: 10px;
}

.address-book .postcode-wrapper .postal-code {
    flex: 1;
}

.address-book .btn-postcode {
    background-color: #5a6268;
    color: white;
    padding: 12px 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    min-width: 140px;
}

.address-book .btn-postcode:hover {
    background-color: #545b62;
}

/* 순서 입력 필드 */
.address-book .order-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 주소록 상세보기 스타일 */
.address-view .view-content {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}

.address-view .info-row {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.address-view .info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.address-view .info-label {
    flex: 0 0 150px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.address-view .info-value {
    flex: 1;
    color: #555;
    font-size: 14px;
}

.address-view .view-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.address-view .btn-list {
    background-color: #3498db;
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.address-view .btn-list:hover {
    opacity: 0.8;
}

.address-view .admin-buttons {
    display: flex;
    gap: 10px;
}

.address-view .btn-update {
    background-color: #2ecc71;
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.address-view .btn-delete {
    background-color: #e74c3c;
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

/* 모바일 반응형 */
@media all and (max-width: 768px) {
    .address-book .address-table {
        display: block;
    }
    
    .address-book .address-table thead {
        display: none;
    }
    
    .address-book .address-table tbody,
    .address-book .address-table tr,
    .address-book .address-table td {
        display: block;
        width: 100%;
    }
    
    .address-book .address-table tr {
        margin-bottom: 20px;
        border: 1px solid #eee;
        border-radius: 10px;
        overflow: hidden;
    }
    
    .address-book .address-table td {
        padding: 15px;
        border-bottom: 1px solid #f0f0f0;
        text-align: left !important;
        position: relative;
        padding-left: 120px;
    }
    
    .address-book .address-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        top: 15px;
        font-weight: bold;
        color: #333;
        font-size: 13px;
    }
    
    .address-book .address-table td:last-child {
        border-bottom: none;
    }
    
    .address-view .info-row {
        flex-direction: column;
    }
    
    .address-view .info-label {
        flex: none;
        margin-bottom: 5px;
    }
    
    .address-view .view-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .address-view .admin-buttons {
        justify-content: flex-start;
    }
    
    .address-book .admin-actions {
        justify-content: flex-start;
    }
}

/* 순서 입력 관련 스타일 */
.order-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.order-buttons {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.order-up, .order-down {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    padding: 0;
    line-height: 1;
}

.order-up:hover, .order-down:hover {
    background-color: #e9e9e9;
    border-color: #AA20FF;
    color: #AA20FF;
}

.order-input {
    width: 60px !important;
    text-align: center;
    padding: 8px 5px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 13px !important;
    font-weight: bold;
}

.update-order-btn {
    background-color: #27ae60 !important;
    color: white !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: normal !important;
}

.update-order-btn:hover {
    background-color: #219653 !important;
    opacity: 0.9 !important;
}

/* 모바일 반응형 - 기존 카드형태 유지, 하단 라인만 추가 */
@media all and (max-width: 768px) {
    /* 순서 입력 필드 최소화 */
    .order-input-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        width: 70px;
        margin: 0 auto;
    }
    
    .order-input {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px;
        padding: 4px 2px !important;
        font-size: 12px !important;
        height: 26px;
        margin: 0 !important;
    }
    
    .order-buttons {
        display: flex;
        gap: 3px;
        margin-top: 0 !important;
    }
    
    .order-up, .order-down {
        width: 20px !important;
        height: 20px !important;
        min-height: 20px !important;
        padding: 0 !important;
        font-size: 9px !important;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 기존 카드 형태 유지하면서 하단 라인만 추가 */
    .address-book .address-table tbody tr {
        border-bottom: 2px solid #eee !important;
        margin-bottom: 15px !important;
    }
    
    .address-book .address-table tbody tr:last-child {
        border-bottom: none !important;
    }
    
    /* 기존 스타일 유지 - 카드 형태 유지 */
    .address-book .address-table {
        display: block !important;
    }
    
    .address-book .address-table thead {
        display: none !important;
    }
    
    .address-book .address-table tbody,
    .address-book .address-table tr,
    .address-book .address-table td {
        display: block !important;
        width: 100% !important;
    }
    
    .address-book .address-table tr {
        margin-bottom: 20px !important;
        border: 1px solid #eee !important;
        border-radius: 10px !important;
        overflow: hidden !important;
    }
    
    .address-book .address-table td {
        padding: 15px !important;
        border-bottom: 1px solid #f0f0f0 !important;
        text-align: left !important;
        position: relative !important;
        padding-left: 120px !important;
    }
    
    .address-book .address-table td:before {
        content: attr(data-label) !important;
        position: absolute !important;
        left: 15px !important;
        top: 15px !important;
        font-weight: bold !important;
        color: #333 !important;
        font-size: 13px !important;
    }
    
    .address-book .address-table td:last-child {
        border-bottom: none !important;
    }
    
    /* 순서 셀 특별 처리 */
    .cell-order[data-label]:before {
        content: "" !important;
        display: none !important;
    }
    
    .cell-order {
        text-align: center !important;
        padding-left: 15px !important;
    }
    
    /* 주소 정보 정렬 */
    .address-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    
    .address-separator {
        display: none;
    }
    
    /* 관리 버튼 정렬 */
    .admin-actions {
        justify-content: flex-start !important;
    }
}

/* 모바일 반응형 - 순서번호 왼쪽 정렬 수정만 */
@media all and (max-width: 768px) {
    /* 순서 입력 필드 최소화 및 왼쪽 정렬 */
    .cell-order .order-input-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-start !important; /* 왼쪽 정렬로 변경 */
        gap: 3px;
        width: auto;
        margin: 0 !important;
        justify-content: flex-start !important;
    }
    
    .cell-order .order-input {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px;
        padding: 4px 2px !important;
        font-size: 12px !important;
        height: 26px;
        margin: 0 !important;
        margin-left: 0 !important; /* 왼쪽 정렬 */
    }
    
    .cell-order .order-buttons {
        display: flex;
        gap: 3px;
        margin-top: 0 !important;
        justify-content: flex-start !important; /* 왼쪽 정렬 */
    }
    
    .cell-order .order-up,
    .cell-order .order-down {
        width: 20px !important;
        height: 20px !important;
        min-height: 20px !important;
        padding: 0 !important;
        font-size: 9px !important;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 순서 셀 특별 처리 - 라벨 표시 및 왼쪽 정렬 */
    .cell-order[data-label]:before {
        content: attr(data-label) !important; /* "순서" 라벨 표시 유지 */
        display: block !important;
        position: absolute !important;
        left: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-weight: bold !important;
        color: #333 !important;
        font-size: 13px !important;
        width: 80px !important;
    }
    
    .cell-order {
        text-align: left !important; /* 왼쪽 정렬 */
        justify-content: flex-start !important; /* 왼쪽 정렬 */
        display: flex !important;
        align-items: center !important;
    }
    
    /* 순서 입력 필드 컨테이너 위치 조정 */
    .cell-order .order-input-wrapper {
        margin-left: 90px !important; /* 라벨 오른쪽에 배치 */
    }
}

/* 모바일 반응형 - 순서 왼쪽 정렬 및 높이 균일화 */
@media all and (max-width: 768px) {
    /* 모든 셀의 높이를 동일하게 */
    .address-book .address-table td {
        min-height: 50px !important;
        display: flex !important;
        align-items: center !important;
        padding: 15px !important;
        border-bottom: 1px solid #f0f0f0 !important;
        text-align: left !important;
        position: relative !important;
        padding-left: 120px !important;
        box-sizing: border-box !important;
    }
    
    /* 라벨 위치 중앙 정렬 */
    .address-book .address-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-weight: bold;
        color: #333;
        font-size: 13px;
        width: 80px;
    }
    
    /* 순서 입력창 왼쪽 정렬 */
    .cell-order {
        padding-left: 120px !important;
    }
    
    .cell-order[data-label]:before {
        content: attr(data-label) !important;
        display: block !important;
        position: absolute !important;
        left: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-weight: bold !important;
        color: #333 !important;
        font-size: 13px !important;
        width: 80px !important;
    }
    
    /* 순서 입력 필드 컨테이너 왼쪽 정렬 */
    .cell-order .order-input-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 3px !important;
        width: auto !important;
        margin: 0 !important;
        margin-left: 0 !important;
    }
    
    /* 순서 입력창 왼쪽 정렬 */
    .cell-order .order-input {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px;
        padding: 4px 2px !important;
        font-size: 12px !important;
        height: 26px;
        margin: 0 !important;
        margin-left: 0 !important;
        text-align: center !important;
    }
    
    /* 순서 버튼 왼쪽 정렬 */
    .cell-order .order-buttons {
        display: flex !important;
        gap: 3px !important;
        margin-top: 0 !important;
        justify-content: flex-start !important;
    }
    
    .cell-order .order-up,
    .cell-order .order-down {
        width: 20px !important;
        height: 20px !important;
        min-height: 20px !important;
        padding: 0 !important;
        font-size: 9px !important;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 관리 버튼 정렬 */
    .cell-actions .admin-actions {
        display: flex;
        justify-content: flex-start;
        gap: 5px;
        width: 100%;
    }
    
    /* 주소 정보 정렬 */
    .address-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        width: 100%;
    }
    
    .address-separator {
        display: none;
    }
    
    /* 카드 하단 라인 유지 */
    .address-book .address-table tbody tr {
        border-bottom: 2px solid #eee !important;
        margin-bottom: 15px !important;
    }
    
    .address-book .address-table tbody tr:last-child {
        border-bottom: none !important;
    }
}