/* css/ui.css - UI 컴포넌트 스타일 */

/* 턴 정보 */
#turn-info {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    text-align: center;
}

.turn-text {
    font-size: 1.1rem;
    font-weight: bold;
}

/* 플레이어 정보 */
.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.player-color {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.player-details {
    flex: 1;
}

.player-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.player-score {
    color: #f1c40f;
    font-size: 1.2rem;
}

.player-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.9rem;
}

.player-stats div {
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

/* 자원 표시 */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.resource-icon {
    font-size: 1.3rem;
}

.resource-name {
    flex: 1;
    font-size: 0.85rem;
    color: #bdc3c7;
}

.resource-count {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2ecc71;
    min-width: 25px;
    text-align: center;
}

/* 개발 카드 */
.dev-cards-list {
    max-height: 150px;
    overflow-y: auto;
}

.dev-cards-list::-webkit-scrollbar {
    width: 6px;
}

.dev-cards-list::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

.no-cards {
    color: #7f8c8d;
    text-align: center;
    padding: 15px;
    font-style: italic;
}

.dev-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 8px;
}

.dev-card-item:last-child {
    margin-bottom: 0;
}

.dev-card-name {
    font-size: 0.9rem;
}

.use-card-btn {
    padding: 5px 12px;
    font-size: 0.8rem;
    background: #9b59b6;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.use-card-btn:hover:not(:disabled) {
    background: #8e44ad;
}

.use-card-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
}

/* 액션 버튼 */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    padding: 12px;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(52, 152, 219, 0.3);
    color: #ecf0f1;
    border: 1px solid rgba(52, 152, 219, 0.5);
}

.action-btn:hover:not(:disabled) {
    background: rgba(52, 152, 219, 0.5);
    transform: translateX(3px);
}

.action-btn:disabled {
    background: rgba(127, 140, 141, 0.3);
    color: #7f8c8d;
    cursor: not-allowed;
    border-color: rgba(127, 140, 141, 0.3);
}

.action-btn.primary {
    background: rgba(46, 204, 113, 0.4);
    border-color: rgba(46, 204, 113, 0.6);
}

.action-btn.primary:hover:not(:disabled) {
    background: rgba(46, 204, 113, 0.6);
}

.action-btn.secondary {
    background: rgba(155, 89, 182, 0.4);
    border-color: rgba(155, 89, 182, 0.6);
}

.action-btn.secondary:hover:not(:disabled) {
    background: rgba(155, 89, 182, 0.6);
}

/* 건설 비용 */
.build-costs {
    font-size: 0.9rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cost-item:last-child {
    border-bottom: none;
}

/* 자원 선택기 */
.resource-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.resource-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resource-picker-item:hover {
    background: rgba(52, 152, 219, 0.3);
}

.resource-picker-item.selected {
    background: rgba(46, 204, 113, 0.4);
    border: 2px solid #2ecc71;
}

.resource-picker-item .icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.resource-picker-item .count {
    font-size: 1.2rem;
    font-weight: bold;
}

.resource-picker-item .controls {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.resource-picker-item .controls button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #3498db;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-picker-item .controls button:hover {
    background: #2980b9;
}

/* 거래 모달 */
.trade-modal-content {
    min-width: 500px;
}

.trade-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.trade-tab {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #bdc3c7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trade-tab:hover {
    background: rgba(52, 152, 219, 0.3);
}

.trade-tab.active {
    background: #3498db;
    color: white;
}

.trade-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
}

.trade-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.trade-column {
    flex: 1;
}

.trade-column h4 {
    margin-bottom: 10px;
    color: #f1c40f;
}

.trade-column select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    font-size: 1rem;
}

.trade-column select option {
    background: #2c3e50;
}

.trade-arrow {
    font-size: 2rem;
}

.trade-ratio {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #f1c40f;
}

.trade-resources {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-resource-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trade-resource-row .icon {
    font-size: 1.5rem;
}

.trade-resource-row input {
    width: 60px;
    padding: 8px;
    border-radius: 5px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    text-align: center;
}

.trade-result {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    text-align: center;
}

.trade-result.success {
    background: rgba(46, 204, 113, 0.3);
}

.trade-result.failure {
    background: rgba(231, 76, 60, 0.3);
}

/* 게임 종료 모달 */
.game-over-content {
    text-align: center;
}

.final-scores {
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.final-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.final-score-item:last-child {
    border-bottom: none;
}

.final-score-item.winner {
    background: rgba(241, 196, 15, 0.3);
    border-radius: 8px;
}

.final-score-item .player-info-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.final-score-item .color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.final-score-item .score {
    font-size: 1.3rem;
    font-weight: bold;
    color: #f1c40f;
}

/* 접을 수 있는 패널 */
.collapsible h3 {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible h3::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.collapsible.collapsed h3::after {
    transform: rotate(-90deg);
}

.collapsible.collapsed .build-costs {
    display: none;
}

/* 안내 메시지 */
.instruction-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(52, 152, 219, 0.9);
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    z-index: 100;
    animation: slideDown 0.3s ease;
}

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

/* 취소 버튼 */
.cancel-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 30px;
    background: #e74c3c;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 100;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #c0392b;
}

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

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

.panel {
    animation: slideUp 0.3s ease;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.8);
}

/* 플레이어 거래 스타일 */
.trade-resources {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.trade-resource-item span:first-child {
    font-size: 0.9rem;
}

.trade-counter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trade-counter .minus-btn,
.trade-counter .plus-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: #3498db;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.trade-counter .minus-btn:hover,
.trade-counter .plus-btn:hover {
    background: #2980b9;
}

.trade-counter .count {
    min-width: 24px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.trade-result {
    margin-top: 10px;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
}

.trade-success {
    color: #2ecc71;
    font-weight: bold;
}

.trade-rejected {
    color: #e74c3c;
    font-weight: bold;
}

.trade-error {
    color: #f39c12;
    font-weight: bold;
}
