/* assets/css/myprofile.css */

/* 프로필 스타일 */

.myprofile-container {
    font-size: 16px;
}

.profile-info-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #2C9A5C;
}

.profile-manage-badge {
    background: #2C9A5C;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.form-control-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

.form-switch .form-check-input {
    width: 2em;
    margin-left: -2.5em;
    cursor: pointer;
}

.profile-info-container {
    padding: 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
    display: grid;
    font-size: 15px;
    grid-template-columns: 25% 1fr;
    gap: 100px;
}

/* 프로필 헤더 영역 */
.profile-header {
    display: flex;
    gap: 24px;
    align-items: center;
}

.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-name-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.display-name {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.profile-info .last-name {
    font-size: 20px;
}

.profile-badge {
    padding: 5px 10px;
    background: #2C9A5C;
    color: white;
    border-radius: 3px;
    font-size: 16px;
    margin-top: 10px;
    display: block;
    width: fit-content;
}

.profile-badge:hover,
.profile-badge:focus {
    background: #2C9A5C;
    color: white;
}

.last-name {
    color: #666;
}

/* 정보 영역 */
.contact-info {}

.info-row {
    display: flex;
    padding: 7px 0;
    border-bottom: 1px solid #f2f2f2;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    width: 80px;
    color: #666;
    padding: 3px 0 0;
}

.info-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alrt {
    color: #F8A539;
    font-size: 13px;
    margin-left: 3px;
    font-weight: 400;
}

.edit-btn,
.password-link {
    color: #333;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 11px;
    background: #F2F2F2;
    border-radius: 30px;
}


.visibility-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-input {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.info-row.phone-row .info-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.info-row .info-content .input-wrap {
    display: flex;
    gap: 15px;
    align-items: center;
}

.info-row.del-account .info-content {
    justify-content: flex-end;
}

.info-row.del-account .info-content button {
    color: #6f6f6f;
    border: none;
    background: none;
    font-size: 14px;
    padding: 0px 4px;
    border-bottom: 1px solid #d4d4d4;
}

.hidden {
    display: none;
}

/* 토글 스위치 스타일 */
.visibility-toggle input[type="checkbox"] {
    appearance: none;
    width: 40px;
    height: 20px;
    background: #ddd;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.visibility-toggle input[type="checkbox"]:checked {
    background: #2C9A5C;
}

.visibility-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
}

.visibility-toggle input[type="checkbox"]:checked::before {
    left: 22px;
}

.visibility-toggle label {
    font-size: 14px;
    color: #666;
}

/* 라디오 버튼 스타일 */
.radio-group {
    display: flex;
    gap: 0px;
}

.radio-label {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-text {
    padding: 2px 10px;
    border-radius: 2px;
    font-size: 13px;
    background: #333;
    /* 기본 배경색 (비공개) */
    color: white;
    transition: background-color 0.3s ease;
}

/* 공개 선택 시 스타일 */
.radio-label input[type="radio"][value="1"]:checked+.radio-text {
    background: #2C9A5C;
    /* 파란색 배경 */
}

/* 비공개 선택 시 스타일 */
.radio-label input[type="radio"][value="0"]:checked+.radio-text {
    background: #333;
    /* 검은색 배경 */
}

/* 호버 효과 */
.radio-label:hover .radio-text {
    opacity: 0.9;
}

/* 선택 안된 상태의 스타일 */
.radio-label input[type="radio"]:not(:checked)+.radio-text {
    background: #e9ecef;
    color: #495057;
}

.profile-nav-container ul {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.profile-nav-container ul li a {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: #1C1C1E;
    padding: 14px 0;
    border-bottom: 5px solid transparent;
}

.profile-nav-container ul li a.active {
    border-color: #2C9A5C;
    color: #2C9A5C;
    font-weight: bold;
}

/* 전체 컨테이너 스타일 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 15px;
}

/* 카드 스타일 */
.card {
    border: none;
    margin-bottom: 10px;
}

.card-header {
    background-color: transparent;
    border: 0;
    padding: 30px 0;
}

.card-header h3 {
    margin: 0;
    font-size: 22px;
    color: #1C1C1E;
    font-weight: bold;
}

.card-body {
    padding: 0;
    border: 0;
    box-shadow: none;
}

form#treeSalesForm .req {
    font-weight: 300;
    color: #2B9A5B;
}

/* 이미지 업로드 영역 */
.image-upload-section {
    margin-bottom: 2rem;
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.image-preview {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-preview.empty:hover {
    background: #e9ecef;
    border-color: #2C9A5C;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.image-preview .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-preview .delete-btn:hover {
    background: rgba(220, 53, 69, 1);
}

.image-preview .drag-handle {
    position: absolute;
    top: 5px;
    left: 5px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 3px;
    cursor: move;
    z-index: 2;
}

/* 이미지 아이템 */
.profile-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #ddd;
    cursor: move;
    /* 드래그 가능한 커서 표시 */
    user-select: none;
    /* 드래그 중 텍스트 선택 방지 */
}

.profile-image-item:nth-child(2):after {
    content: "메인";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: fit-content;
    background: #00000082;
    color: #fff;
    text-align: center;
    font-size: 16px;
}

.profile-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image-item .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.2s;
    z-index: 2;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

/* 이미지 업로드 섹션 */
.profile-images-section {
    margin-bottom: 40px;
}

.profile-images-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.profile-images-section h3 small {
    font-size: 14px;
    color: #666;
    margin-left: 10px;
}

.profile-images-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 20px;
}


/* 이미지 업로드 플레이스홀더 */
.profile-image-placeholder {
    position: relative;
    aspect-ratio: 1;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.profile-image-placeholder:hover {
    border-color: #999;
    background: #f9f9f9;
}

.profile-image-placeholder input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.profile-image-placeholder i {
    font-size: 34px;
    color: #2C9A5C;
    margin-bottom: 8px;
}

.profile-image-placeholder span {
    font-size: 14px;
    color: #666;
}

.profile-image-placeholder label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    height: 100%;
    justify-content: center;
    cursor: pointer;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .profile-images-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .profile-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 폼 요소 스타일 */
.form-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.form-control {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #2C9A5C;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* 버튼 스타일 */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #2C9A5C;
    border-color: #2C9A5C;
}

.btn-primary:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
}

/* 라디오 버튼 그룹 스타일 */
.btn-group {
    margin-bottom: 1rem;
}

.btn-check:checked+.btn-outline-primary,
.btn-group .btn.active {
    background-color: #2C9A5C;
    border-color: #2C9A5C;
    color: white;
    font-weight: bold;
}

.btn-outline-primary {
    color: #2C9A5C;
    border-color: #2C9A5C;
}

.btn-outline-primary:hover {
    background-color: #2C9A5C;
    border-color: #2C9A5C;
}

.btn-group .btn {
    font-size: 16px;
    padding: 10px 30px;
    border: 1px solid #D1D1D6;
    color: #636366;
    border-radius: 3px;
    margin-right: 10px !important;
}

/* 규격 입력 섹션 */
.spec-inputs {
    margin-top: 1.5rem;
}

.spec-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.spec-input-group input {
    max-width: 150px;
}

/* 모달 스타일 */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

.modal-title {
    color: #2c3e50;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

/* 자주 쓰는 문구 스타일 */
.saved-phrase-item {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.saved-phrase-item:hover {
    background-color: #f8f9fa;
}

.saved-phrase-item .controls {
    display: flex;
    gap: 0.5rem;
}

/* 주소 입력 그룹 */
.address-input-group {
    position: relative;
    display: flex;
    gap: 0.5rem;
}

/* 필수 입력 표시 */
.required-field::after {
    content: "*";
    color: #dc3545;
    margin-left: 4px;
}

/* 설명 텍스트영역 */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-size: 16px;
}

/* 도움말 텍스트 */
.help-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* 제출 버튼 영역 */
.submit-section {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
}

.btn-submit {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* 알림 메시지 */
.alert {
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .image-preview {
        width: 120px;
        height: 120px;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    .btn-group .btn {
        flex: 1 1 auto;
        margin-bottom: 0.5rem;
    }

    .spec-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .spec-input-group input {
        max-width: none;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}

/* 드래그 앤 드롭 관련 스타일 */
.ui-sortable-placeholder {
    visibility: visible !important;
    background: #f0f8ff;
    border: 2px dashed #2C9A5C;
    border-radius: 8px;
}

.ui-sortable-helper {
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* 유효성 검사 스타일 */
.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

.was-validated .form-control:invalid~.invalid-feedback,
.form-control.is-invalid~.invalid-feedback {
    display: block;
}

/* 로딩 스피너 */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* 툴팁 스타일 */
.tooltip {
    position: absolute;
    z-index: 1070;
    display: block;
    font-size: 0.875rem;
}

.tooltip-inner {
    max-width: 200px;
    padding: 0.25rem 0.5rem;
    color: #fff;
    text-align: center;
    background-color: #000;
    border-radius: 0.25rem;
}


.btn-outline-secondary.active {
    background-color: #6c757d !important;
    color: white !important;
    border-color: #6c757d !important;
}

.hidden {
    display: none !important;
}


#defaultSpecInputs .form-label {
    font-size: 16px;
}

.tree-list-container .empty-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    text-align: center;
    padding: 60px 0;
    font-size: 18px;
    color: #636366;
}

.input-group .btn {
    position: relative;
    z-index: 2;
    font-size: 14px;
    background: #2C9A5C;
    color: #fff;
    border: 0;
}

.input-group button#recentAddressBtn {
    position: absolute;
    right: 0;
    bottom: 100%;
    background: none;
    color: #2C9A5C;
}

.sales-form-select-container {
    padding: 20px 0 200px;
}

.sales-form-select-container h5 {
    font-size: 18px;
    margin: 30px 0 20px;
}

.sales-form-select-container ul {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.sales-form-select-container ul li {
    position: relative;
    width: 100%;
    height: 100%;
}

.sales-form-select-container ul li a {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 21px;
    font-weight: bold;
    padding-bottom: 65%;
    height: 0;
}

.sales-form-select-container ul li a .tit {
    padding: 20px 25px;
    color: #fff;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.sales-form-select-container ul li a .tag {
    font-size: 16px;
    color: #333;
    position: absolute;
    top: 100%;
    padding: 10px 0;
    font-weight: 400;
}


.sales-form-select-container ul li a img {
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    width: 100%;
}

#recentAddressList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#recentAddressList .list-group-item button img {
    width: 20px;
}

#recentAddressList .list-group-item button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #333;
    text-decoration: none;
    border: 1px solid #e6e6e6;
    padding: 11px 15px;
    background: #fafafa;
    font-weight: 600;
}

.description-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.description-header button#savedPhrasesBtn {
    position: relative;
    z-index: 2;
    font-size: 16px;
    background: #2C9A5C;
    color: #fff;
    border: 0;
    padding: 7px 15px;
    border-radius: 0;
}

#savedPhrasesList .btn-group {
    align-items: center;
    padding: 0;
    margin: 0;
}

#savedPhrasesList .btn-group button {
    color: #fff;
    font-size: 13px;
    padding: 4px 10px;
    border: 0;
    border-radius: 3px;
}

#defaultSpecInputs .spec-header {
    padding: 10px !important;
    border-radius: 5px !important;
}

form#treeSalesForm button[type=submit] {
    font-size: 16px;
    padding: 10px 25px;
    border-radius: 0;
}

.sales-history-container .tree-list {
    padding: 0 15px;
}

.admin-search-form form {
    display: flex;
    gap: 5px;
}

.admin-search-form form button,
.admin-search-form form a {
    font-size: 14px;
    height: 44px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0 15px;
    border-radius: 3px;
}

.admin-search-form form input {
    font-size: 15px;
    height: 44px;
    border-radius: 3px;
}

.admin-search-form {
    margin-bottom: 10px;
}

.admin-search-container .alert {
    width: fit-content;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 3px;
}

@media screen and (max-width: 768px) {
    .sales-form-select-container ul {
        grid-template-columns: repeat(1, 1fr);
        gap: 40px;
    }

    .sales-form-select-container ul li {
        padding-bottom: 20px;
    }

    .profile-nav-container ul li a {
        font-size: 17px;
        padding: 9px 0;
        border-bottom: 3px solid transparent;
    }

    .sales-form-select-container h5 {
        font-size: 16px;
    }

    .sales-history-container .tree-list {
        padding: 0;
    }

    .profile-info-container {
        padding: 15px;
        font-size: 15px;
        grid-template-columns: 100%;
        gap: 20px;
    }

    .info-label {
        width: 63px;
    }

    .profile-header {
        gap: 18px;
    }

    .avatar-wrapper {
        width: 80px;
        height: 80px;
    }

    .display-name {
        font-size: 20px;
    }

    .profile-info .last-name {
        font-size: 18px;
    }

    .profile-badge {
        padding: 5px 10px;
        font-size: 14px;
    }

    .visibility-toggle {
        gap: 4px;
        flex-wrap: wrap;
    }
}