/* 프로필 페이지 스타일 */

.profile-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.profile-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* 계정 정보 카드 */
.profile-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: #111827;
    font-weight: 500;
}

/* 비밀번호 카드 */
.password-card {
    padding: 1.5rem;
}

.password-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.password-info i {
    color: #10b981;
}

/* 결제카드 관리 */
.cards-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.card-item.default {
    border-color: #3b82f6;
    background: #eff6ff;
}

.card-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #111827;
}

.card-brand i {
    font-size: 1.5rem;
    color: #1f2937;
}

.card-number {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #6b7280;
    letter-spacing: 0.05em;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.default-badge {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.btn-icon {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #ef4444;
}

/* 등록 기기 관리 */
.devices-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.device-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
    position: relative;
}

.device-item.active {
    border-color: #10b981;
    background: #f0fdf4;
}

.device-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.device-item.active .device-icon {
    background: #dcfce7;
    color: #10b981;
}

.device-info {
    flex: 1;
}

.device-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.device-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.device-type, .device-os {
    background: #f3f4f6;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #374151;
}

.device-os {
    background: #e0f2fe;
    color: #0277bd;
}

.device-description {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
    margin-top: 0.25rem;
    padding: 0.25rem 0;
    border-top: 1px solid #f1f5f9;
}

.device-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.active {
    background: #dcfce7;
    color: #10b981;
}

/* 고객 지원 카드 */
.support-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.support-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.support-info i {
    font-size: 2rem;
    opacity: 0.9;
}

.support-text h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.support-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.875rem;
}

/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex !important;
}

.modal.show {
    display: flex !important;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* 체크박스 스타일 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 기기 등록 정보 */
.device-detection-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.detection-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.detection-header i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.detection-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.detected-device-info {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detected-device-info.detected {
    background: #f0fdf4;
    border-color: #22c55e;
}

.detected-device-info.error {
    background: #fef2f2;
    border-color: #ef4444;
}

.detected-device-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

.detected-device-info.detected p {
    color: #16a34a;
}

.detected-device-info.error p {
    color: #dc2626;
}

.detected-device-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.detected-device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.detected-device-item:last-child {
    border-bottom: none;
}

.detected-device-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.detected-device-value {
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 600;
}

.manual-input-section {
    position: relative;
}

.section-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.section-divider span {
    background: white;
    padding: 0 1rem;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.device-limit {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    text-align: center;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .profile-container {
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.125rem;
    }
    
    .profile-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        gap: 1rem;
    }
    
    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 0.75rem;
    }
    
    .info-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .info-label {
        font-size: 0.875rem;
        color: #6b7280;
    }
    
    .info-value {
        font-size: 1rem;
        font-weight: 500;
    }
    
    .password-card {
        padding: 1rem;
    }
    
    .password-info {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .cards-container {
        padding: 1rem;
    }
    
    .card-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .card-brand {
        font-size: 0.875rem;
    }
    
    .card-number {
        font-size: 0.875rem;
        word-break: break-all;
    }
    
    .card-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .devices-container {
        padding: 1rem;
    }
    
    .device-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
        position: relative;
    }
    
    .device-status {
        position: static;
        transform: none;
        width: 100%;
        justify-content: space-between;
        margin-top: 0.5rem;
    }
    
    .device-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .device-info {
        width: 100%;
    }
    
    .device-name {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .device-details {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .device-type, .device-os, .device-date {
        font-size: 0.75rem;
    }
    
    .device-description {
        font-size: 0.7rem;
        margin-top: 0.5rem;
    }
    
    .device-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .support-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .support-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* 버튼 크기 조정 */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-icon {
        padding: 0.5rem;
        font-size: 1rem;
    }
}

/* 더 작은 화면 (480px 이하) */
@media (max-width: 480px) {
    .profile-container {
        padding: 0 0.5rem;
    }
    
    .section-header {
        padding: 0.75rem;
    }
    
    .profile-card {
        padding: 0.75rem;
    }
    
    .cards-container,
    .devices-container {
        padding: 0.75rem;
    }
    
    .card-item,
    .device-item {
        padding: 0.75rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .info-value {
        font-size: 0.875rem;
    }
    
    .card-number {
        font-size: 0.75rem;
    }
    
    .device-name {
        font-size: 0.875rem;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-section {
    animation: fadeIn 0.3s ease-out;
}

/* 호버 효과 */
.card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.device-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 로딩 상태 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
