/* ==========================================================================
   Push Manager 공통 스타일시트
   ========================================================================== */

/* 기본 리셋 및 베이스 스타일 */
* {
    box-sizing: border-box;
}


/* ==========================================================================
   컨테이너 및 레이아웃
   ========================================================================== */

.pushmanager-container {
    width: 100%;
    padding: 40px 20px;
    background: #fff;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 50px 0;
    background: #f8f9fa;
    border-radius: 0;
    border-bottom: 1px solid #e9ecef;
}

.page-header-content {
    max-width: 600px;
    margin: 0 auto;
}

.page-title {
    font-size: 36px;
    margin: 0 0 16px 0;
    color: #212529;
    border: none;
    padding: 0;
    font-weight: 300;
    letter-spacing: -1px;
}

.page-subtitle {
    color: #6c757d;
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
}

/* ==========================================================================
   섹션 스타일
   ========================================================================== */

.section {
    margin: 50px 0;
}

.section-title {
    font-size: 22px;
    margin-bottom: 25px;
    color: #333;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.section-title .emoji {
    margin-right: 12px;
    font-size: 24px;
}

/* ==========================================================================
   푸시 구독 섹션
   ========================================================================== */

.push-subscription-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.push-subscription-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.push-subscription-icon {
    font-size: 20px;
    margin-right: 8px;
    color: #3b82f6;
}

.push-subscription-title {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
    color: #1e293b;
}

.push-subscription-description {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    color: #64748b;
}

.push-status-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.push-status-info {
    flex: 1;
}

.push-status-text {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    color: #1e293b;
}

.push-status-detail {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.push-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-checking {
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.status-success {
    background: #10b981;
}

.status-warning {
    background: #f59e0b;
}

.status-error {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==========================================================================
   버튼 스타일
   ========================================================================== */

.btn-push {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    justify-content: center;
}

.btn-push:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-push:active {
    transform: translateY(0);
}

.btn-push:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-push.secondary {
    background: #6b7280;
}

.btn-push.secondary:hover {
    background: #4b5563;
}

.btn-test {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-test:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-test:active {
    transform: translateY(0);
}

.btn-test:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-test.sending {
    background: #f59e0b;
}

.btn-test.success {
    background: #10b981;
}

.btn-test.error {
    background: #ef4444;
}

.btn-test-all {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-test-all:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-test-all:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-save {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-save:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-save:active {
    transform: translateY(0);
}

.btn-save:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.push-action-buttons {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.loading-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   설정 아이템 및 그리드
   ========================================================================== */

.setting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.setting-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.setting-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: #1e293b;
    font-weight: 600;
}

.setting-info p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

/* ==========================================================================
   스위치 토글
   ========================================================================== */

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    transition: all 0.2s ease;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    transition: all 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: #3b82f6;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ==========================================================================
   기기 목록
   ========================================================================== */

.device-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.device-item {
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.device-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.device-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    flex-shrink: 0;
}

.device-details {
    flex: 1;
    min-width: 0;
}

.device-details h5 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: #1e293b;
    font-weight: 600;
}

.device-details small {
    color: #64748b;
    font-size: 13px;
    display: block;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-status {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.status-active {
    color: #059669;
}

.status-inactive {
    color: #dc2626;
}

.device-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ==========================================================================
   특별 섹션들
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

.empty-state .emoji {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.5;
}

.test-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #fcd34d;
}

.test-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #92400e;
    font-weight: 600;
}

.test-section p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #92400e;
    line-height: 1.5;
}

.save-section {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

/* 탭 네비게이션 스타일 */
.tab-navigation {
    margin-bottom: 30px;
}

.tab-nav-container {
    display: flex;
    gap: 0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    padding: 4px;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.tab-btn.active {
    background: #ffffff;
    color: #1e293b;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-content {
    background: #ffffff;
    border-radius: 0 0 8px 8px;
    padding: 0;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .tab-nav-container {
        flex-direction: column;
        gap: 2px;
    }
    
    .tab-btn {
        flex: none;
        text-align: center;
        padding: 16px 20px;
        border-radius: 6px;
    }
    
    .tab-btn.active::after {
        display: none;
    }
    
    .tab-btn.active {
        background: #3b82f6;
        color: #ffffff;
    }
}

/* 대체 스타일 (더 심플한 버전) */
.tab-navigation.simple {
    border-bottom: 2px solid #e5e7eb;
    background: none;
}

.tab-navigation.simple .tab-nav-container {
    background: none;
    padding: 0;
    border-radius: 0;
    gap: 32px;
}

.tab-navigation.simple .tab-btn {
    background: none;
    border-radius: 0;
    padding: 16px 0;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
}

.tab-navigation.simple .tab-btn:hover {
    background: none;
    color: #374151;
    border-bottom-color: #d1d5db;
}

.tab-navigation.simple .tab-btn.active {
    background: none;
    color: #1f2937;
    border-bottom-color: #3b82f6;
    box-shadow: none;
}

.tab-navigation.simple .tab-btn.active::after {
    display: none;
}

/* ==========================================================================
   반응형 미디어 쿼리
   ========================================================================== */

@media (max-width: 1200px) {
    .pushmanager-container {
        padding: 30px 15px;
    }
    
    .setting-grid {
        grid-template-columns: 1fr;
    }
    
    .device-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .push-status-container {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .push-action-buttons {
        margin-left: 0;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .pushmanager-container {
        padding: 20px 10px;
    }
    
    .page-header {
        margin-bottom: 30px;
        padding: 40px 20px;
    }
    
    .page-title {
        font-size: 30px;
    }
    
    .page-subtitle {
        font-size: 15px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .setting-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .device-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .switch {
        margin-top: 15px;
        align-self: flex-end;
    }
    
    .device-item {
        padding: 16px;
    }
    
    .device-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .device-info {
        width: 100%;
        align-items: flex-start;
    }
    
    .device-controls {
        width: 100%;
        justify-content: flex-end;
        align-items: center;
        margin-top: 0;
    }
    
    .device-details small {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    
    .btn-save {
        padding: 12px 30px;
        font-size: 16px;
        width: 100%;
        max-width: 300px;
    }
    
    .push-subscription-section {
        padding: 24px;
    }
    
    .push-subscription-title {
        font-size: 20px;
    }
    
    .push-subscription-description {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pushmanager-container {
        padding: 15px 8px;
    }
    
    .page-header {
        margin-bottom: 25px;
        padding: 35px 15px;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .page-subtitle {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 18px;
        flex-direction: column;
        text-align: center;
    }
    
    .section-title .emoji {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .setting-item, .device-item {
        padding: 12px;
    }
    
    .setting-info h4 {
        font-size: 16px;
    }
    
    .device-details h5 {
        font-size: 14px;
    }
    
    .device-controls {
        gap: 8px;
    }
    
    .btn-test {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .push-subscription-section {
        padding: 20px;
    }
    
    .push-subscription-icon {
        font-size: 28px;
    }
    
    .push-subscription-title {
        font-size: 18px;
    }
    
    .push-status-container {
        padding: 16px;
    }
    
    .push-action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-push {
        width: 100%;
    }
}