/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #60a5fa;
    --accent-color: #93c5fd;
    --text-color: #1e3a8a;
    --text-light: #64748b;
    --bg-color: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --card-bg: #ffffff;
    --border-color: #bae6fd;
    --shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
    --shadow-hover: 0 8px 30px rgba(59, 130, 246, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #3b82f6, #60a5fa);
    --gradient-secondary: linear-gradient(135deg, #93c5fd, #bfdbfe);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-radius: 0 0 30px 30px;
    overflow: hidden;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.header-text {
    flex: 1;
}

/* 모바일 환경에서 헤더 레이아웃 조정 */
@media (max-width: 768px) {
    .header-content {
        gap: 1rem;
    }
    
    .header-logo {
        width: 50px;
        height: 50px;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="3" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100vw); }
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: left;
}

header h1::before {
    display: none;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    text-align: left;
}

/* 카운트다운 스타일 */
.countdown-container {
    margin-top: 1.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.countdown-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.countdown-timer {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.countdown-timer span {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 2.5rem;
    text-align: center;
    animation: countdownPulse 2s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.back-button {
    display: inline-block;
    color: white;
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 1rem;
    opacity: 0.9;
    transition: var(--transition);
    position: relative;
    z-index: 10;
}

.back-button:hover {
    opacity: 1;
    transform: translateX(-5px);
}

/* 사용자 헤더 */
.user-header {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    min-height: 50px;
    min-width: 120px;
    justify-content: center;
}

/* 상세 프로필 페이지에서 사용자 헤더 숨김 */
.profile-detail-page .user-header {
    display: none !important;
}

.user-header:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-header:active {
    transform: translateY(0);
    opacity: 0.8;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.user-status {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}


/* 메인 콘텐츠 */
main {
    padding: 3rem 0;
    min-height: calc(100vh - 250px);
}

/* 로딩 */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* 검색창 스타일 */
.search-container {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-in;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: var(--text-light);
    font-size: 1.2rem;
    opacity: 0.7;
}

.clear-search-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.clear-search-btn:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.search-results-info {
    text-align: center;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-weight: 500;
}

.search-results-info .search-count {
    color: var(--primary-color);
    font-weight: 600;
}

/* 사용자 그리드 */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.5s ease-in;
}

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

/* 사용자 카드 */
.user-card {
    background: var(--card-bg);
    border-radius: 0px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    border: 2px solid transparent;
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-secondary);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
    border-radius: 0px;
}

.user-card.selectable {
    cursor: default;
}

.user-card.selected {
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    transform: translateY(-4px);
    animation: selectedPulse 2s ease-in-out infinite;
    position: relative;
    overflow: visible;
}

.user-card.selected::after {
    content: '💖';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 24px;
    z-index: 100;
    animation: heartFloat 1.5s ease-in-out infinite;
}

@keyframes selectedPulse {
    0%, 100% { 
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
        transform: translateY(-4px);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
        transform: translateY(-6px);
    }
}

@keyframes heartFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translateY(-8px) scale(1.1);
        opacity: 0.9;
    }
}

/* 선택 시 즉시 애니메이션 */
.user-card.selecting {
    animation: selectBounce 0.6s ease-out;
    border: 3px solid #10b981;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.3);
}

@keyframes selectBounce {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0px rgba(16, 185, 129, 0.5);
    }
    30% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.3);
    }
    60% { 
        transform: scale(0.98);
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0.1);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }
}

/* 체크박스 선택 애니메이션 */
.user-checkbox:checked + .checkbox-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    animation: checkboxSelect 0.4s ease-out;
}

@keyframes checkboxSelect {
    0% { 
        transform: scale(1);
        background: rgba(255, 255, 255, 0.9);
    }
    50% { 
        transform: scale(1.3);
        background: #10b981;
    }
    100% { 
        transform: scale(1);
        background: var(--primary-color);
    }
}

/* 선택 완료 축하 애니메이션 */
.celebration-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
    animation: celebrationPop 1s ease-out;
}

@keyframes celebrationPop {
    0% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    50% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

.celebration-text {
    font-size: 2rem;
    font-weight: bold;
    color: #10b981;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: celebrationBounce 0.6s ease-out;
}

@keyframes celebrationBounce {
    0%, 100% { transform: translateY(0px); }
    25% { transform: translateY(-20px); }
    50% { transform: translateY(-10px); }
    75% { transform: translateY(-15px); }
}

/* 알림 애니메이션 */
@keyframes slideInRight {
    0% { 
        transform: translateX(100%);
        opacity: 0;
    }
    100% { 
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    0% { 
        transform: translateX(0);
        opacity: 1;
    }
    100% { 
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 최대 선택 알림 스타일 */
.max-selection-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    font-weight: 600;
    max-width: 300px;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-emoji {
    font-size: 1.2rem;
    animation: shake 0.5s ease-in-out;
}

.alert-text {
    font-size: 0.9rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* 슈퍼 라이크 모드 알림 애니메이션 */
@keyframes slideInDown {
    0% { 
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    100% { 
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutUp {
    0% { 
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% { 
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

/* 저장 중 스피너 */
.saving-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.saving-text {
    font-size: 1rem;
    font-weight: 600;
}

/* 성공 애니메이션 */
@keyframes successPop {
    0% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.success-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 0.6s ease-out;
}

.success-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.success-subtext {
    font-size: 0.9rem;
    opacity: 0.8;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 슈퍼 라이크 모드 버튼 */
.super-like-mode-btn {
    position: absolute;
    top: 20px;
    right: 180px;
    background: linear-gradient(135deg, #ec4899, #f472b6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 일반 모드로 전환 버튼 스타일 */
.super-like-mode-btn.normal-mode {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.super-like-mode-btn.normal-mode:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.super-like-mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.super-like-mode-btn:active {
    transform: translateY(0);
}

.super-like-icon {
    font-size: 1.1rem;
    animation: heartBeat 2s ease-in-out infinite;
}

.super-like-text {
    font-size: 0.9rem;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 슈퍼 라이크 모드 배경 */
body.super-like-mode {
    background: #ffffff;
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 슈퍼 라이크 모드 카드 스타일 */
.super-like-mode .user-card {
    border: 3px solid #ec4899;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.3);
    animation: superLikeGlow 2s ease-in-out infinite;
    background: #ffffff;
    border-radius: 0px;
}

@keyframes superLikeGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
        transform: translateY(-4px);
    }
    50% { 
        box-shadow: 0 0 30px rgba(236, 72, 153, 0.5);
        transform: translateY(-6px);
    }
}

/* 폭죽 애니메이션 */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: fireworkExplode 1s ease-out forwards;
}

@keyframes fireworkExplode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* 슈퍼 라이크 선택 애니메이션 */
.super-like-selecting {
    animation: superLikeBounce 0.8s ease-out;
    border: 3px solid #ec4899;
    box-shadow: 0 0 0 5px rgba(236, 72, 153, 0.3);
}

@keyframes superLikeBounce {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0px rgba(236, 72, 153, 0.5);
    }
    30% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(236, 72, 153, 0.3);
    }
    60% { 
        transform: scale(0.95);
        box-shadow: 0 0 0 25px rgba(236, 72, 153, 0.1);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 30px rgba(236, 72, 153, 0);
    }
}

/* 슈퍼 라이크 모드에서 선택 제한 */
.super-like-mode .user-card.selectable {
    cursor: pointer;
}

.super-like-mode .user-card.selected {
    border: 3px solid #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
    transform: translateY(-4px);
    animation: superLikeSelectedPulse 2s ease-in-out infinite;
    background: #ffffff;
    border-radius: 0px;
}

/* 슈퍼 라이크 모드 체크박스 스타일 */
.super-like-mode .selection-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(236, 72, 153, 0.9);
    border-radius: 50%;
    padding: 5px;
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    animation: superLikeCheckboxGlow 2s ease-in-out infinite;
}

.super-like-mode .user-checkbox {
    display: none;
}

.super-like-mode .checkbox-label {
    display: block;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid #ec4899;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.super-like-mode .checkbox-label:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

.super-like-mode .user-checkbox:checked + .checkbox-label {
    background: #ec4899;
    border-color: #ec4899;
    animation: superLikeCheckboxSelect 0.4s ease-out;
}

.super-like-mode .user-checkbox:checked + .checkbox-label::after {
    content: '💖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    animation: superLikeHeartBeat 0.6s ease-out;
}

@keyframes superLikeCheckboxGlow {
    0%, 100% { 
        box-shadow: 0 0 0 0px rgba(236, 72, 153, 0.3);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(236, 72, 153, 0.1);
    }
}

@keyframes superLikeCheckboxSelect {
    0% { 
        transform: scale(1);
        background: rgba(255, 255, 255, 0.9);
    }
    50% { 
        transform: scale(1.3);
        background: #ec4899;
    }
    100% { 
        transform: scale(1);
        background: #ec4899;
    }
}

@keyframes superLikeHeartBeat {
    0% { transform: translate(-50%, -50%) scale(1); }
    25% { transform: translate(-50%, -50%) scale(1.2); }
    50% { transform: translate(-50%, -50%) scale(1); }
    75% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* 기존 매칭 삭제 알림 */
.clear-matches-alert {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.3);
    animation: slideInUp 0.5s ease-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.clear-matches-alert .alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clear-matches-alert .alert-icon {
    font-size: 20px;
    animation: bounce 0.6s ease-in-out;
}

.clear-matches-alert .alert-text {
    font-weight: 600;
    font-size: 14px;
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    0% {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
}

/* 슈퍼 라이크 결과 페이지 스타일 */
.super-like-result-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3);
    background-size: 400% 400%;
    animation: rainbowShift 3s ease-in-out infinite;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    color: white;
    text-align: center;
}

.super-like-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: superLikeBounce 2s ease-in-out infinite;
}

.result-date {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.super-like-user-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    color: #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.user-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.user-image-item {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.user-image-item:hover {
    transform: scale(1.05);
}

.user-image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.user-info h3 {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 0.5rem;
}

.job-title {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.location {
    font-size: 1rem;
    color: #888;
    margin-bottom: 1rem;
}

.description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
}

.super-like-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #4ecdc4, #6dd5ed);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(78, 205, 196, 0.3);
}

.no-result-container {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3);
    background-size: 400% 400%;
    animation: rainbowShift 3s ease-in-out infinite;
    border-radius: 20px;
    color: white;
}

.no-result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: superLikeBounce 2s ease-in-out infinite;
}

.no-result-container h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.no-result-container p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* 슈퍼 라이크 결과 페이지에서 헤더 스타일 */
.super-like-mode header {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3);
    background-size: 400% 400%;
    animation: rainbowShift 3s ease-in-out infinite;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.super-like-mode header h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.super-like-mode .back-button {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.super-like-mode .back-button:hover {
    color: #f0f0f0;
}

/* 슈퍼 라이크 결과 페이지에서만 슈퍼 라이크 버튼 숨기기 */
.super-like-results-page .super-like-mode-btn {
    display: none !important;
}

/* 슈퍼 라이크 결과 페이지 모바일 스타일 - 헤더 텍스트는 원래 크기 유지 */

/* 슈퍼 라이크 결과 컨테이너 내부 h2 텍스트 모바일 스타일 */
@media (max-width: 768px) {
    .super-like-results-page .super-like-header h2 {
        font-size: 1.4rem !important;
        line-height: 1.2 !important;
    }
}

@media (max-width: 480px) {
    .super-like-results-page .super-like-header h2 {
        font-size: 1.1rem !important;
        line-height: 1.1 !important;
    }
}

@media (max-width: 360px) {
    .super-like-results-page .super-like-header h2 {
        font-size: 0.95rem !important;
        line-height: 1 !important;
    }
}

@media (max-width: 320px) {
    .super-like-results-page .super-like-header h2 {
        font-size: 0.85rem !important;
        line-height: 1 !important;
    }
}

/* 슈퍼 라이크 결과 페이지 스타일 (다시 선택하기 버튼 제거됨) */

/* 상세 프로필 페이지에서만 슈퍼 라이크 버튼 숨기기 */
.profile-detail-page .super-like-mode-btn {
    display: none !important;
}

/* 결과 페이지에서만 슈퍼 라이크 버튼 숨기기 */
.results-page .super-like-mode-btn {
    display: none !important;
}

/* 슈퍼 라이크 결과 페이지 액션 버튼 스타일 */
.super-like-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem;
}

.super-like-actions .btn {
    min-width: 150px;
    text-align: center;
}

@keyframes superLikeSelectedPulse {
    0%, 100% { 
        box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
        transform: translateY(-4px);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(236, 72, 153, 0.1);
        transform: translateY(-6px);
    }
}

/* 슈퍼 라이크 모드 모바일 스타일 */
@media (max-width: 768px) {
    .super-like-mode-btn {
        position: fixed;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        z-index: 1000;
        box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    }
    
    .super-like-mode-btn .super-like-text {
        display: none;
    }
    
    /* 모바일에서 팝업 글씨 크기 줄이기 */
    .max-selection-alert {
        padding: 0.8rem 1.2rem;
        max-width: 280px;
        font-size: 0.8rem;
    }
    
    .alert-text {
        font-size: 0.75rem;
    }
    
    .alert-emoji {
        font-size: 1rem;
    }
    
    .user-header {
        position: fixed;
        top: 20px;
        right: 70px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 40px;
        z-index: 1000;
    }
    
    .user-header .user-info {
        display: none;
    }
    
    .user-header::after {
        content: '👤';
        font-size: 1rem;
    }
    
    /* 상세 프로필 페이지에서 사용자 헤더 숨김 */
    .profile-detail-page .user-header {
        display: none !important;
    }
}

.user-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.user-card:hover::before {
    opacity: 0.1;
}

.user-card.selectable:hover {
    transform: translateY(-4px);
}

.user-card.selected:hover {
    transform: translateY(-6px);
}

/* 선택 완료 상태에서는 호버 효과 제거 */
.user-card:not(.selectable):hover {
    transform: none;
    box-shadow: var(--shadow);
}

.user-card-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: var(--border-color);
}

.user-card-content {
    padding: 0.4rem 0.75rem 0.75rem 0.75rem;
}

.user-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-color);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card .job {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.user-card .location {
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
    margin-top: 0.25rem;
}

/* 선택 기능 스타일 */
.selection-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.user-checkbox {
    display: none;
}

.checkbox-label {
    display: block;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.user-checkbox:checked + .checkbox-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.user-checkbox:checked + .checkbox-label::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.user-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* 선택 UI */
.selection-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* Floating Save Button */
.floating-save-btn {
    position: fixed !important;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999 !important;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 200px;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    visibility: visible !important;
    opacity: 1 !important;
}

.floating-save-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.5);
}

.floating-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: translateX(-50%);
}

.floating-save-btn .save-icon {
    font-size: 1.1rem;
}

.floating-save-btn .save-text {
    font-weight: 600;
}

.floating-save-btn .selected-names {
    font-size: 0.9rem;
    opacity: 0.9;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selection-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.selection-actions .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.selection-actions .btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.selection-actions .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 프로필 상세 */
.profile-detail {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease-in;
}

.profile-header {
    position: relative;
}

.profile-images {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.profile-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.profile-image.active {
    opacity: 1;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid white;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

.indicator.active {
    background: white;
}

.profile-info {
    padding: 1rem;
}

.profile-main {
    margin-bottom: 1rem;
}

.profile-main h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.job-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.bio {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.8;
}

.profile-contact {
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
}

.profile-contact h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.contact-item .icon {
    font-size: 1.5rem;
    width: 2rem;
}

/* 에러 메시지 */
.error {
    text-align: center;
    padding: 3rem 2rem;
}

.error h2 {
    color: #dc2626;
    margin-bottom: 1rem;
}

.error p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

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

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

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* 푸터 */
footer {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    border-radius: 30px 30px 0 0;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
}

footer p {
    opacity: 0.8;
}

/* 반응형 디자인 */

/* 태블릿 (768px 이하) */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .user-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .user-card-image {
        height: 200px;
    }

    .profile-images {
        height: 350px;
    }

    .profile-info {
        padding: 0.75rem;
    }

    .profile-main h2 {
        font-size: 1.5rem;
    }

    .job-title {
        font-size: 1.1rem;
    }

    .bio {
        font-size: 1rem;
    }
}

/* 모바일에서 코인 아이콘 크기 조정 */
@media (max-width: 768px) {
    .user-card .coin-indicators {
        padding: 1px 4px;
        gap: 1px;
    }
    
    .coin-icon {
        font-size: 10px;
        filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
        -webkit-filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
        color: #c0c0c0 !important;
    }
    
    .user-name-row {
        gap: 0.25rem;
    }
}

/* 모바일 (480px 이하) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    header {
        padding: 1.5rem 0;
    }
    
    /* 모바일에서 뒤로 가기 버튼 좌측 상단 고정 */
    .back-button {
        position: absolute;
        top: 15px;
        left: 15px;
        z-index: 1000;
        margin-bottom: 0;
        font-size: 0.9rem;
        background: none;
        padding: 0;
        border-radius: 0;
        backdrop-filter: none;
        border: none;
    }

    /* 프로필 페이지에서 제목을 가운데 정렬 */
    .profile-detail-page header h1 {
        font-size: 1.3rem;
        text-align: center;
        margin-left: 60px; /* 뒤로가기 버튼 공간 확보 */
        margin-right: 60px; /* 우측 공간 확보 */
    }
    
    header h1 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }
    
    /* 작은 모바일에서 floating 버튼 강화 */
    .floating-save-btn {
        bottom: 10px !important;
        padding: 0.6rem 1.8rem !important;
        min-width: 220px !important;
        font-size: 0.75rem !important;
        z-index: 9999 !important;
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: var(--gradient-primary) !important;
        color: white !important;
        border-radius: 20px !important;
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4) !important;
        backdrop-filter: blur(10px) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
    }
    .floating-save-btn .save-text {
        font-size: 0.7rem !important;
    }
    
    .floating-save-btn .selected-names {
        max-width: 100px !important;
        font-size: 0.7rem !important;
    }

    .countdown-container {
        margin-top: 1rem;
    }

    .countdown-timer {
        font-size: 1rem;
        gap: 0.3rem;
    }

    .countdown-timer span {
        padding: 0.2rem 0.4rem;
        min-width: 2rem;
        font-size: 0.9rem;
    }

    main {
        padding: 2rem 0;
    }

    /* 검색창 모바일 스타일 */
    .search-container {
        margin-bottom: 1.5rem;
    }

    .search-input {
        padding: 0.8rem 2.5rem 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .search-input::placeholder {
        font-size: 1rem;
    }

    .clear-search-btn {
        right: 0.8rem;
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    .search-results-info {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .user-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .user-card-image {
        height: 200px;
    }

    .user-card-content {
        padding: 0.4rem 0.4rem 0.4rem 0.4rem;
    }

    .user-card h3 {
        font-size: clamp(0.85rem, 3vw, 1.1rem);
    }
    
    .user-card .coin-indicators {
        padding: 1px 3px;
    }
    
    .coin-icon {
        font-size: 9px;
        filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
        -webkit-filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
        color: #c0c0c0 !important;
    }

    .user-card .job {
        font-size: 0.9rem;
    }

    .user-card .location {
        font-size: 0.85rem;
    }

    .selection-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .selection-actions .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .floating-save-btn {
        bottom: 15px !important;
        padding: 0.65rem 2rem !important;
        min-width: 240px !important;
        font-size: 0.8rem !important;
        z-index: 9999 !important;
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: var(--gradient-primary) !important;
        color: white !important;
        border-radius: 25px !important;
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4) !important;
        backdrop-filter: blur(10px) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    .floating-save-btn .save-text {
        font-size: 0.75rem !important;
    }
    
    .floating-save-btn .selected-names {
        max-width: 120px;
        font-size: 0.75rem !important;
    }

    .super-like-mode-btn {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .user-header {
        top: 15px;
        right: 60px;
        width: 35px;
        height: 35px;
        min-width: 35px;
        min-height: 35px;
    }
    
    .user-header::after {
        font-size: 0.9rem;
    }
    
    /* 상세 프로필 페이지에서 사용자 헤더 숨김 */
    .profile-detail-page .user-header {
        display: none !important;
    }

    .profile-images {
        height: 280px;
    }

    .profile-info {
        padding: 0.5rem;
    }

    .profile-main {
        margin-bottom: 0.75rem;
    }

    .profile-main h2 {
        font-size: 1.3rem;
    }

    .job-title {
        font-size: 1rem;
    }

    .bio {
        font-size: 0.95rem;
    }

    .profile-contact h3 {
        font-size: 1.1rem;
    }

    .contact-item {
        font-size: 0.9rem;
    }

    .contact-item .icon {
        font-size: 1.3rem;
    }

    footer {
        margin-top: 2rem;
        padding: 1.5rem 0;
        font-size: 0.9rem;
    }
}

/* 초소형 모바일 (360px 이하) */
@media (max-width: 360px) {
    /* 초소형 모바일에서 뒤로 가기 버튼 위치 조정 */
    .back-button {
        top: 10px;
        left: 10px;
        font-size: 0.85rem;
        padding: 0;
        background: none;
        border-radius: 0;
        border: none;
    }
    
    /* 프로필 페이지에서 제목을 가운데 정렬 (360px 이하) */
    .profile-detail-page header h1 {
        font-size: 1.1rem;
        text-align: center;
        margin-left: 50px; /* 뒤로가기 버튼 공간 확보 */
        margin-right: 50px; /* 우측 공간 확보 */
    }
    
    .user-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .user-card-image {
        height: 160px;
    }

    .user-card-content {
        padding: 0.4rem 0.5rem 0.5rem 0.5rem;
    }

    .user-card h3 {
        font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    }
    
    .user-card .coin-indicators {
        padding: 1px 2px;
        gap: 0;
    }
    
    .coin-icon {
        font-size: 8px;
        filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
        -webkit-filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
        color: #c0c0c0 !important;
    }

    .user-card .job {
        font-size: 0.8rem;
    }

    .user-card .location {
        font-size: 0.75rem;
    }

    /* 초소형 모바일에서 팝업 글씨 크기 더 작게 */
    .max-selection-alert {
        padding: 0.6rem 1rem;
        max-width: 260px;
        font-size: 0.75rem;
    }
    
    .alert-text {
        font-size: 0.7rem;
    }
    
    .alert-emoji {
        font-size: 0.9rem;
    }

    .selection-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .selection-actions .btn {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .floating-save-btn {
        bottom: 10px !important;
        padding: 0.55rem 1.6rem !important;
        min-width: 200px !important;
        font-size: 0.7rem !important;
    }
    
    .floating-save-btn .save-text {
        font-size: 0.65rem !important;
    }
    
    .floating-save-btn .selected-names {
        max-width: 90px !important;
        font-size: 0.65rem !important;
    }

    .profile-images {
        height: 250px;
    }
}

/* 매우 작은 화면 (320px 이하) - 2개 컬럼 강제 유지 */
@media (max-width: 320px) {
    /* 매우 작은 화면에서 뒤로 가기 버튼 위치 조정 */
    .back-button {
        top: 8px;
        left: 8px;
        font-size: 0.8rem;
        padding: 0;
        background: none;
        border-radius: 0;
        border: none;
    }
    
    /* 프로필 페이지에서 제목을 가운데 정렬 (320px 이하) */
    .profile-detail-page header h1 {
        font-size: 0.9rem;
        text-align: center;
        margin-left: 40px; /* 뒤로가기 버튼 공간 확보 */
        margin-right: 40px; /* 우측 공간 확보 */
    }
    
    .user-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.25rem;
    }
    
    .user-card-image {
        height: 140px;
    }

    .user-card-content {
        padding: 0.4rem 0.3rem 0.3rem 0.3rem;
    }

    .user-card h3 {
        font-size: clamp(0.7rem, 2vw, 0.8rem);
    }
    
    .user-card .coin-indicators {
        padding: 0 2px;
        gap: 0;
    }
    
    .coin-icon {
        font-size: 7px;
        filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
        -webkit-filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
        color: #c0c0c0 !important;
    }

    .user-card .job {
        font-size: 0.7rem;
    }

    .user-card .location {
        font-size: 0.65rem;
    }


    .selection-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .selection-actions .btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .floating-save-btn {
        bottom: 8px !important;
        padding: 0.5rem 1.4rem !important;
        min-width: 180px !important;
        font-size: 0.65rem !important;
    }
    
    .floating-save-btn .save-text {
        font-size: 0.6rem !important;
    }
    
    .floating-save-btn .selected-names {
        max-width: 80px !important;
        font-size: 0.6rem !important;
    }
    
    .super-like-mode-btn {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .user-header {
        top: 10px;
        right: 50px;
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
    }
    
    .user-header::after {
        font-size: 0.8rem;
    }
    
    /* 상세 프로필 페이지에서 사용자 헤더 숨김 */
    .profile-detail-page .user-header {
        display: none !important;
    }
}

/* 코인 아이콘 스타일 */
.coin-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 0;
}

.coin-icon {
    font-size: 12px;
    opacity: 0.9;
    transition: var(--transition);
    filter: grayscale(0.8) brightness(1.1) contrast(1.1);
    text-shadow: 0 1px 2px rgba(192, 192, 192, 0.5);
    animation: coinFloat 3s ease-in-out infinite;
    -webkit-filter: grayscale(0.8) brightness(1.1) contrast(1.1);
    color: #c0c0c0;
}

.coin-icon:nth-child(2) {
    animation-delay: 0.5s;
}

.coin-icon:nth-child(3) {
    animation-delay: 1s;
}

@keyframes coinFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(5deg); }
}

.coin-icon:hover {
    opacity: 1;
    transform: scale(1.2) rotate(10deg);
    filter: grayscale(0.6) brightness(1.2) contrast(1.2);
    text-shadow: 0 2px 4px rgba(192, 192, 192, 0.7);
    -webkit-filter: grayscale(0.6) brightness(1.2) contrast(1.2);
}

/* 사용된 코인 (silver 색상, empty circle) */
.coin-used .coin-icon {
    filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
    -webkit-filter: grayscale(0.8) brightness(1.1) contrast(1.1) !important;
    opacity: 0.8 !important;
    animation: none !important;
    color: #c0c0c0 !important;
}

.coin-used .coin-icon:hover {
    filter: grayscale(0.6) brightness(1.2) contrast(1.1) !important;
    -webkit-filter: grayscale(0.6) brightness(1.2) contrast(1.1) !important;
    transform: scale(1.1);
}

/* 사용자 카드에서 코인 아이콘 위치 조정 */
.user-card-content {
    position: relative;
}

/* 사용자 이름과 코인을 같은 라인에 배치 */
.user-name-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.user-name-row h3 {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    min-width: 0; /* 텍스트 오버플로우 방지 */
    order: 1;
    line-height: 1.2;
}

.user-card .coin-indicators {
    flex-shrink: 0;
    margin-left: auto;
    order: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 1px 4px;
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    align-self: center;
}


/* 프로필 이미지 그리드 스타일 */
.profile-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.profile-image-grid-item {
    position: relative;
    border-radius: 12px;
    overflow: visible;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.profile-image-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.profile-image-grid-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: var(--transition);
    border-radius: 12px;
}

.profile-image-grid-item:hover img {
    transform: scale(1.05);
}

/* 반응형 그리드 */
@media (max-width: 768px) {
    .profile-images-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .profile-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .profile-images-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 이미지 확대 모달 스타일 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10001;
}

.image-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.image-modal-body {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

/* 모달 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 반응형 모달 */
@media (max-width: 768px) {
    .image-modal-content {
        max-width: 95%;
        max-height: 95%;
        margin: 1rem;
    }
    
    .image-modal-close {
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
        top: 10px;
        right: 10px;
    }
    
    .modal-image {
        max-height: 70vh;
    }
}

/* 추가 귀여운 요소들 */
.selection-info {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 15px;
    padding: 8px 16px;
    margin-top: 10px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(10px);
}

/* 로딩 스피너 */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
    position: relative;
}

/* 사용자 카드 효과 */
.user-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

/* 버튼 효과 */
.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* 배경에 떠다니는 원들 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(59,130,246,0.1)"/></svg>') repeat;
    animation: backgroundFloat 30s infinite linear;
    pointer-events: none;
    z-index: -1;
}

@keyframes backgroundFloat {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

/* 운명의 행시 스타일 */
.destiny-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 15px;
    border: 2px solid #f59e0b;
    text-align: center;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

.destiny-poem-btn {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    margin-bottom: 1rem;
}

.destiny-poem-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.destiny-poem-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.destiny-description {
    color: #92400e;
    font-size: 0.95rem;
    margin: 0;
}

/* 운명의 행시 모달 */
.destiny-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.destiny-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.destiny-modal-header {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    padding: 1.5rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.destiny-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.destiny-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.destiny-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.destiny-modal-body {
    padding: 2rem;
}

.poem-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #1f2937;
    text-align: center;
    white-space: pre-line;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid #f59e0b;
}

.destiny-modal-footer {
    padding: 1rem 2rem 2rem;
    text-align: center;
}

.destiny-modal-close-btn {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.destiny-modal-close-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 운명의 행시 모바일 스타일 */
@media (max-width: 768px) {
    .destiny-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .destiny-modal-header {
        padding: 1rem;
    }
    
    .destiny-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .destiny-modal-body {
        padding: 1.5rem;
    }
    
    .poem-content {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .destiny-poem-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* 이미지 업로드 관련 스타일 */
.image-upload-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    z-index: 10;
}

.profile-image-grid-item:hover .image-upload-overlay {
    opacity: 1;
}

.upload-icon {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    transition: all 0.3s ease;
}

.image-upload-overlay:hover .upload-icon {
    color: white;
    transform: scale(1.1);
}

.uploaded-image-item {
    position: relative;
    display: inline-block;
    margin: 5px;
}

.uploaded-image-item img {
    border-radius: 8px;
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
}

.delete-image-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.uploaded-image-item:hover .delete-image-btn {
    opacity: 1;
}

.delete-image-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.file-input-hidden {
    display: none;
}

.upload-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-align: center;
}

.upload-progress h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-success {
    color: #10b981;
    font-weight: 600;
}

.upload-error {
    color: #ef4444;
    font-weight: 600;
}


.uploaded-images-section {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.uploaded-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.uploaded-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.uploaded-image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.uploaded-image-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    cursor: pointer;
}
