/* ===============================================
   다파 실적관리 시스템 - 목록 페이지 스타일
   =============================================== */


/* 기본 변수 정의 */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #50C878;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --info-color: #3498DB;
    --dark-color: #2C3E50;
    --light-color: #ECF0F1;
    --white: #FFFFFF;
    --gray-light: #F8F9FA;
    --gray-medium: #6C757D;
    --gray-dark: #343A40;
    
    /* 그림자 효과 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    
    /* 애니메이션 */
    --transition-base: all 0.3s ease;
    
    /* 레이아웃 */
    --container-max-width: none;
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

/* Bootstrap container 오버라이드 - DAPA 게시판에서만 적용 */
/* board-container가 있는 페이지에서만 작동 */

/* 컨테이너 - 다른 게시판과 일관성을 위해 폭 제한 제거 */
.board-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 20px;
}

/* 타이틀 */
.board-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 관리자 메뉴 */
.admin-menu-container {
    margin-bottom: 20px;
    text-align: right;
}

.btn-admin {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--warning-color), #E67E22);
    color: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #E67E22, var(--warning-color));
}

/* 실적 요약 카드 */
.dapa-summary-card {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #fefefe 0%, #f9f9f9 50%, #f5f5f5 100%);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    color: #374151;
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.dapa-summary-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.summary-card-body {
    position: relative;
    z-index: 1;
}

/* 기간 정보 */
.period-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

/* 전체 누적 PV 표시 */
.total-pv-info {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.total-pv-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 3px;
}

.total-pv-value {
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 확정상품 강화 스타일 */
.achieved-product-highlight {
    background: linear-gradient(165deg, #ffffff 5%, #fbbf24 50%, #fdb602 100%);
    border: 3px solid #fff;
    border-radius: 15px;
    padding: 10px 15px;
    margin: 5px 0;
    box-shadow: 
        0 8px 25px rgba(107, 114, 128, 0.3),
        0 0 0 1px rgba(156, 163, 175, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.achieved-product-highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255,255,255,0.2) 50%, 
        transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.achieved-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.achieved-badge i {
    color: #9ca3af;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

.achieved-label {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 100;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}

.achieved-product-name {
    color: #fff;
    font-size: clamp(12px, 5vw, 28px);
    font-weight: bold;
    text-shadow: 0 3px 6px rgba(0,0,0,0.5);
    text-align: center;
    position: relative;
    z-index: 1;
    letter-spacing: 1px;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 다음 목표 미니 스타일 */
.next-target-mini {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 6px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.next-target-mini .mini-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.next-target-mini .mini-product {
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.next-target-mini .mini-pv {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
}

/* 차수 격려 메시지 */
.sequence-motivation {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.sequence-motivation i {
    color: #9ca3af;
    font-size: 14px;
    animation: flicker 2s ease-in-out infinite alternate;
}

@keyframes flicker {
    0% { opacity: 1; }
    100% { opacity: 0.7; }
}

.sequence-motivation span {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    line-height: 1.3;
}

.period-info h4, .period-info h5 {
    font-size: clamp(20px, 4vw, 24px);
    margin: 0;
    font-weight: 600;
    color: #000000;
    white-space: nowrap;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
}

.badge-info {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* PV 정보 */
.pv-info {
    margin-bottom: 10px;
}

.current-pv {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 0px;
    justify-content: flex-end;
}

.current-pv .value {
    font-size: clamp(18px, 8vw, 48px);
    font-weight: bold;
    color: #0d47a1;
    text-shadow: 1px 1px 2px rgba(13, 71, 161, 0.3);
    white-space: nowrap;
}

.current-pv .unit {
    font-size: clamp(9px, 6vw, 28px);
    font-weight: bold;
    color: #ff0000;
    opacity: 0.8;
    white-space: nowrap;
    margin-right: 15px;
}

/* 달성 상품 정보 */
.achieved-product {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.achieved-info, .next-target {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.achieved-info:last-child, .next-target:last-child {
    margin-bottom: 0;
}

.achieved-info .label, .next-target .label {
    font-size: 14px;
    opacity: 0.9;
    color: #424242;
}

.achieved-info .product, .next-target .product {
    font-size: 18px;
    font-weight: 600;
    color: #1565c0;
}

.required-pv {
    font-size: 14px;
    opacity: 0.8;
    color: #424242;
}

/* 프로그레스 바 */
.progress-container {
    margin-top: 8px;
    margin-left: 15px;
    margin-right: 15px;
}

.progress {
    height: 2px;
    background: rgb(0 0 0 / 20%);
    border-radius: 4px; /* 보더도 비례 축소 */
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #dd8484, #ff0303);
    border-radius: 4px; /* 보더도 비례 축소 */
    position: relative;
    transition: width 0.6s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-text {
    color: white;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    position: absolute;
    white-space: nowrap;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes rabbit-hop {
    0%, 90%, 100% {
        transform: scale(1) translateY(0) translateX(0);
        font-size: 48px; /* 원래 크기 */
    }
    2% {
        transform: scale(1.05) translateY(-15px) translateX(-12px);
        font-size: 81px; /* 68% 증가 (54px × 1.5) */
    }
    4% {
        transform: scale(1.02) translateY(0) translateX(-18px);
        font-size: 78px; /* 62% 증가 (52px × 1.5) */
    }
    6% {
        transform: scale(1.08) translateY(-20px) translateX(-24px);
        font-size: 87px; /* 81% 증가 (58px × 1.5) */
    }
    8% {
        transform: scale(1.03) translateY(0) translateX(-30px);
        font-size: 84px; /* 75% 증가 (56px × 1.5) */
    }
    10% {
        transform: scale(1.1) translateY(-25px) translateX(-22.5px);
        font-size: 93px; /* 최대 94% 증가 (62px × 1.5) */
    }
    12% {
        transform: scale(1) translateY(0) translateX(0);
        font-size: 48px; /* 원래 크기로 복귀 */
    }
}

/* PV 상세 정보 */
.pv-info-detail {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 14px;
}

.current-pv-display, .target-pv-display {
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 10px;
    border-radius: 5px;
    backdrop-filter: blur(10px);
    font-weight: bold;
    font-size: clamp(8px, 3vw, 14px);
    white-space: nowrap;
}

/* 경고 메시지 */
.sequence-warning {
    background: rgba(255, 193, 7, 5%);
    border: 1px solid rgba(255, 193, 7, 0.5);
    padding: 5px;
    border-radius: var(--border-radius);
    margin-top: 0px;
    margin-left: 15px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.sequence-warning i {
    color: #FFD700;
    font-size: 18px;
}

/* BOX1 상태 표시 - sequence-warning과 동일한 스타일 */
.box1-warning {
    background: rgba(23, 162, 184, 5%);
    border: 1px solid rgba(23, 162, 184, 0.5);
    padding: 5px;
    border-radius: var(--border-radius);
    margin-top: 5px;
    margin-left: 15px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.box1-warning i {
    color: #17a2b8;
    font-size: 18px;
}

.box1-completed {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.5);
    padding: 8px;
    border-radius: var(--border-radius);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.box1-completed i {
    color: #28a745;
    font-size: 18px;
}

/* 액션 버튼들 */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 12px;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-base);
    border: none;
    cursor: pointer;
}

.btn-register {
    background: linear-gradient(135deg, rgba(21, 101, 192, 0.9), rgba(30, 136, 229, 0.8));
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(107, 114, 128, 0.4);
    padding: 8px 30px;
    font-size: 28px;
    font-weight: 900;
    height: 40px;
    min-width: 200px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(21, 101, 192, 0.3);
    display: block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.btn-register::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-register:hover::before {
    left: 100%;
}

@keyframes heartbeat {
    0% { 
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(21, 101, 192, 0.3);
    }
    14% { 
        transform: scale(1.05);
        box-shadow: 0 10px 30px rgba(21, 101, 192, 0.4);
    }
    28% { 
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(21, 101, 192, 0.3);
    }
    42% { 
        transform: scale(1.05);
        box-shadow: 0 10px 30px rgba(21, 101, 192, 0.4);
    }
    70% { 
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(21, 101, 192, 0.3);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(21, 101, 192, 0.3);
    }
}

.btn-register:hover {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.9), rgba(21, 101, 192, 0.9));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(21, 101, 192, 0.4);
}

.btn-view-all {
    background: transparent;
    color: #1565c0;
    border: 1px solid rgba(107, 114, 128, 0.5);
}

.btn-view-all:hover {
    background: rgba(21, 101, 192, 0.15);
    border-color: #1565c0;
}

.btn-add {
    background: linear-gradient(135deg, var(--primary-color), #5BA0F2);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #5BA0F2, var(--primary-color));
}

/* 실적 카드 */
.performance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.performance-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-base);
}

.performance-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #5BA0F2);
    color: white;
    padding: 15px 20px;
}

.card-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.card-header span {
    font-size: 14px;
    opacity: 0.9;
}

.card-body {
    padding: 20px;
}

.card-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--light-color);
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-medium);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--dark-color);
}

.stat-subtitle {
    font-size: 12px;
    color: var(--gray-medium);
    margin-top: 5px;
}

.pv-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--gray-medium);
    margin-bottom: 10px;
}

.list-pv-value {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--danger-color);
}

.list-pv-value .red {
    color: var(--danger-color);
}

/* 애니메이션 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .board-container {
        padding: 8px;
    }
    
    .board-title {
        font-size: 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dapa-summary-card {
        padding: 12px;
    }
    
    .current-pv .value {
        font-size: 36px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .performance-cards {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-register {
        padding: 8px 40px;
        font-size: 28px;
        font-weight: 900;
        height: 40px;
        min-width: 250px;
        letter-spacing: 1.5px;
        box-shadow: 0 10px 30px rgba(21, 101, 192, 0.4);
    }
}

@media (max-width: 480px) {
    .board-container {
        padding: 5px;
    }

    .dapa-summary-card {
        padding: 8px;
        margin-bottom: 15px;
    }

    .current-pv .value {
        font-size: 28px;
    }

    .period-info h4 {
        font-size: 22px;
    }
}

/* 아이폰 등 400px 미만 초소형 화면 */
@media (max-width: 400px) {
    .current-pv .value {
        font-size: 22px !important;
    }

    .current-pv .unit {
        font-size: 22px !important;
    }

    .achieved-product-name {
        font-size: 20px !important;
        letter-spacing: 0.5px;
    }

    .period-info h4, .period-info h5 {
        font-size: 18px !important;
    }

    .current-pv-display, .target-pv-display {
        font-size: 12px !important;
        padding: 3px 6px;
    }

    .board-title {
        font-size: 20px;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }

    .achieved-info, .next-target {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .performance-cards {
        gap: 10px;
    }

    .action-buttons {
        gap: 8px;
        margin-top: 8px;
    }
}

/* 텍스트 정렬 유틸리티 */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* 마진 유틸리티 */
.mb-3 {
    margin-bottom: 1rem;
}

/* 로딩 애니메이션 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 제목 글자 크기 - 가변형 */
.record-title-small {
    font-weight: bold !important;
    color: #333 !important;
    font-size: clamp(11px, 2.5vw, 15px) !important; /* 가변 크기: 최소 11px, 최대 15px (1px씩 증가) */
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* 추가 가변 타이틀 옵션들 */
.record-title-auto {
    font-weight: 100 !important;
    color: #333 !important;
    font-size: clamp(1.1rem, 3.6vw, 21.6px) !important; /* 20% 증가: 16px→19.2px, 18px→21.6px, 3vw→3.6vw */
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2); /* 그림자 효과 추가 */
    transition: all 0.3s ease;
}

.record-title-responsive {
    font-weight: bold !important;
    color: #333 !important;
    font-size: clamp(9px, 2vw, 13px) !important; /* 더 작은 가변 크기 (1px씩 증가) */
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.1;
}

/* DAPA 게시판 컨테이너 스타일 - 100% 폭 */
body.dapa-board .board-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}



/* PV 정보 상세 간격 */
.pv-info-detail {
    margin-top: 8px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    body.dapa-board .board-container {
        padding: 8px;
    }
}