/* 기본 스타일 및 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

:root {
    --primary-color: #ff4444;
    --primary-hover: #ff6666;
    --secondary-color: #1d1d1d;
    --accent-color: #4466ff;
    --text-color: #ffffff;
    --text-secondary: #b0b0b0;
    --background-dark: #1a1a1a;
    --background-card: #2a2a2a;
    --background-modal: #2a2a2a;
    --background-input: #3a3a3a;
    --status-waiting: #44ff44;
    --status-playing: #ff4444;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-dark: 0 8px 30px rgba(0, 0, 0, 0.2);
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
    --transition-speed: 0.3s;
}

body {
    background-color: var(--background-dark);
    color: var(--text-color);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 배경 효과 */
.background-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 68, 68, 0.05) 0%, rgba(26, 26, 26, 0) 70%);
    z-index: -1;
}

.background-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ff4444' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
}

/* 헤더 스타일 */
.main-header {
    background-color: var(--secondary-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-medium);
    position: relative;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand i {
    font-size: 2rem;
    color: var(--primary-color);
}

.brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.guide-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.guide-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-color);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--background-card);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.user-badge:hover {
    background-color: var(--primary-color);
}

.user-badge i {
    font-size: 1rem;
}

/* 메인 컨테이너 */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* 액션 바 스타일 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-container {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
    background-color: var(--background-card);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    transition: all var(--transition-speed);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-container:focus-within {
    box-shadow: 0 0 0 2px var(--primary-color);
}

#room-search {
    flex: 1;
    padding: 0.8rem 1rem;
    background-color: transparent;
    border: none;
    color: var(--text-color);
    font-size: 0.95rem;
    width: 100%;
}

#room-search:focus {
    outline: none;
}

#room-search::placeholder {
    color: var(--text-secondary);
}

#search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

#search-btn:hover {
    background-color: var(--primary-hover);
}

.create-room-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-light);
}

.create-room-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.create-room-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

/* 방 목록 헤더 */
.room-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.room-list-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.room-list-header h2 i {
    color: var(--primary-color);
}

.room-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background-color: var(--background-card);
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-btn:hover {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* 방 목록 스타일 */
.room-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.room-card {
    background-color: var(--background-card);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    box-shadow: var(--shadow-light);
}

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: rgba(255, 255, 255, 0.1);
}

.room-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.room-icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 68, 68, 0.1);
    border-radius: 50%;
}

.room-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.room-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.room-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.room-status {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.status-waiting {
    color: var(--status-waiting);
}

.status-playing {
    color: var(--status-playing);
}

/* 방 없음 메시지 */
.no-rooms {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    text-align: center;
    background-color: var(--background-card);
    border-radius: var(--border-radius-md);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.no-rooms i {
    font-size: 3rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.no-rooms p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 모달 및 오버레이 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 50;
    backdrop-filter: blur(4px);
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--background-modal);
    border-radius: var(--border-radius-md);
    z-index: 100;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-dark);
    overflow: hidden;
}

.modal-content {
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header h3 i {
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all var(--transition-speed);
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

/* 환영 메시지 스타일 */
.welcome-message {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.1), rgba(68, 255, 68, 0.1));
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.welcome-message p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.welcome-message i {
    color: var(--primary-color);
    font-size: 1.1rem;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--background-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.input-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #444;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-speed);
    margin-right: 1rem;
}

.btn-secondary:hover {
    background-color: #666;
}

/* 유틸리티 클래스 */
.hidden {
    display: none !important;
}

.clickable {
    cursor: pointer;
}

/* 반응형 스타일 */
@media (max-width: 1024px) {
    .room-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .create-room-btn {
        width: 100%;
        justify-content: center;
    }
    
    .room-list-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .room-filters {
        width: 100%;
        justify-content: space-between;
    }
    
    .room-list {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .brand h1 {
        font-size: 1.5rem;
    }
    
    .guide-btn span {
        display: none;
    }
    
    .guide-btn {
        padding: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .input-group label {
        font-size: 0.9rem;
    }
    
    .input-group input {
        font-size: 0.9rem;
    }
}

/* 애니메이션 효과 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.room-card, .no-rooms {
    animation: fadeIn 0.3s ease-in-out;
}

/* 특수 효과 - 호버시 글로우 효과 */
.create-room-btn:hover::after {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: var(--border-radius-sm);
    background: var(--primary-color);
    z-index: -1;
    opacity: 0.3;
    filter: blur(8px);
    animation: pulse 2s infinite;
}

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

/* Firefox에서 번호 입력 화살표 숨기기 */
input[type=number] {
    -moz-appearance: textfield;
}

/* 크롬, 사파리, 엣지에서 번호 입력 화살표 숨기기 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
