/**
 * 테라 호스팅 마이페이지 스타일
 *
 * @package Terra_Hosting
 */

/* === 래퍼 === */
.terra-hosting-wrapper {
    max-width: 100%;
}

/* === 첫 번째 섹션 상단 정렬 (메뉴와 맞춤) === */
.terra-hosting-wrapper .hosting-section:first-child {
    margin-top: 0;
}

/* === 섹션 공통 === */
.hosting-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.hosting-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #191f28;
}

.hosting-section .section-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.hosting-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.hosting-section .section-header h2 {
    margin: 0;
}

/* === Credentials 그리드 === */
.credentials-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.credential-label {
    min-width: 100px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    flex-shrink: 0;
}

.credential-value-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.credential-value {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #191f28;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    cursor: text;
}

.credential-value:focus {
    outline: none;
    border-color: #0064FF;
}

/* === 복사/토글 버튼 === */
.copy-btn,
.toggle-password-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover,
.toggle-password-btn:hover {
    background: #f5f5f5;
    border-color: #0064FF;
}

.copy-btn .dashicons,
.toggle-password-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #666;
}

.copy-btn:hover .dashicons,
.toggle-password-btn:hover .dashicons {
    color: #0064FF;
}

.copy-btn.copied {
    background: #d4edda;
    border-color: #28a745;
}

.copy-btn.copied .dashicons {
    color: #28a745;
}

/* === 사이트 링크 === */
.site-links {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* === 상태 정보 === */
.status-info {
    display: flex;
    gap: 24px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-label {
    font-size: 14px;
    color: #666;
}

.status-value {
    font-size: 14px;
    font-weight: 600;
    color: #191f28;
}

/* === 상태 배지 === */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-in_progress {
    background: #fff3cd;
    color: #856404;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* === 백업 리스트 === */
.backup-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.backup-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.backup-name {
    font-size: 14px;
    font-weight: 600;
    color: #191f28;
    word-break: break-all;
}

.backup-date {
    font-size: 13px;
    color: #666;
}

.backup-size {
    font-size: 12px;
    color: #888;
}

.backup-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* === 버튼 === */
.hosting-section .button {
    background: #0064FF !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.hosting-section .button:hover {
    background: #0052d4 !important;
}

.hosting-section .button-small {
    padding: 8px 14px !important;
    font-size: 13px !important;
}

.hosting-section .button-link-delete {
    background: #fff !important;
    color: #dc3545 !important;
    border: 1px solid #dc3545 !important;
}

.hosting-section .button-link-delete:hover {
    background: #dc3545 !important;
    color: #fff !important;
}

.hosting-section .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === 빈 메시지 === */
.hosting-section .empty-message {
    color: #888;
    text-align: center;
    padding: 24px;
    font-size: 14px;
}

/* === 로딩 상태 === */
.terra-loading {
    position: relative;
    pointer-events: none;
}

.terra-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #0064FF;
    border-radius: 50%;
    animation: terra-spin 0.8s linear infinite;
}

@keyframes terra-spin {
    to {
        transform: rotate(360deg);
    }
}

/* === 알림 메시지 === */
.terra-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.terra-notice-success {
    background: #d4edda;
    color: #155724;
}

.terra-notice-error {
    background: #f8d7da;
    color: #721c24;
}

/* === 반응형: 모바일 === */
@media (max-width: 600px) {
    .hosting-section {
        padding: 16px;
        margin-bottom: 16px;
        margin-left: -12px;
        margin-right: -12px;
        border-radius: 0;
    }

    .hosting-section h2 {
        font-size: 17px;
    }

    .hosting-section .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .hosting-section .section-header .button {
        text-align: center;
    }

    /* Credential 필드 */
    .credential-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 14px;
    }

    .credential-label {
        min-width: auto;
        font-size: 13px;
    }

    .credential-value-wrap {
        width: 100%;
    }

    .credential-value {
        font-size: 14px;
        padding: 12px 14px;
    }

    .copy-btn,
    .toggle-password-btn {
        width: 40px;
        height: 40px;
    }

    /* 사이트 링크 */
    .site-links {
        flex-direction: column;
    }

    .site-links .button {
        width: 100%;
        text-align: center;
    }

    /* 상태 정보 */
    .status-info {
        flex-direction: column;
        gap: 12px;
    }

    .status-item {
        justify-content: space-between;
        padding: 12px;
        background: #f8f9fa;
        border-radius: 8px;
    }

    /* 백업 리스트 */
    .backup-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .backup-info {
        gap: 6px;
    }

    .backup-name {
        font-size: 13px;
    }

    .backup-actions {
        width: 100%;
        justify-content: stretch;
    }

    .backup-actions .button {
        flex: 1;
        text-align: center;
    }

    /* 버튼 */
    .hosting-section .button {
        padding: 14px 18px !important;
        font-size: 15px !important;
    }

    .hosting-section .button-small {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }
}
