/* Custom CSS for KWordGame */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    margin-top: -76px; /* Compensate for fixed navbar */
    padding-top: 76px;
}

/* Feature Icons */
.feature-icon {
    transition: transform 0.3s ease;
}

.card:hover .feature-icon {
    transform: scale(1.1);
}

/* Game Preview */
.game-preview {
    transition: transform 0.3s ease;
}

.game-preview:hover {
    transform: translateY(-5px);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero-section {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* Custom Button Styles */
.btn-primary {
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
    border: 1px solid #dee2e6;
    color: #495057;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-outline-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Card Animations */
.card {
    transition: all 0.3s ease;
    border-radius: 15px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%) !important;
    border-bottom: 1px solid #dee2e6;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Social Links */
.social-links a {
    transition: all 0.3s ease;
    display: inline-block;
}

.social-links a:hover {
    transform: translateY(-2px);
    color: #6c757d !important;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #e9ecef 0%, #adb5bd 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #adb5bd 0%, #6c757d 100%);
}

/* Form Styles */
.form-control:focus {
    border-color: #adb5bd;
    box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.25);
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive Images */
.img-fluid {
    border-radius: 10px;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Touch-friendly buttons for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .bg-light {
        background-color: #2d2d2d !important;
    }
}

/* Word Chain Game Styles */
.word-chain-section {
    padding: 1rem 0;
    min-height: calc(100vh - 120px); /* 상단바와 하단바 높이 제외 */
}

/* Input Group Enhancements */
.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Game Status Animations */
.alert {
    transition: all 0.3s ease;
}

.alert-danger {
    animation: shake 0.5s ease-in-out;
}

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

/* Mobile Optimizations */
@media (max-width: 768px) {
    .word-chain-section {
        padding: 0.5rem 0;
    }
    
    .form-control-lg {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* Bottom Navigation Enhancements */
.navbar.fixed-bottom {
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.navbar.fixed-bottom .nav-link {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.navbar.fixed-bottom .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    border-radius: 0.375rem;
}

.navbar.fixed-bottom .nav-link.active {
    background-color: rgba(255,255,255,0.2);
    border-radius: 0.375rem;
}

.navbar.fixed-bottom i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

/* Top Navigation */
.navbar.fixed-top {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Card Enhancements */
.card {
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: none;
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border-bottom: none;
}

/* Button Enhancements */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary {
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
    border: 1px solid #dee2e6;
    color: #495057;
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
}

.btn-warning {
    background: linear-gradient(45px, #ffc107, #fd7e14);
    border: none;
    color: #212529;
}

/* Form Control Enhancements */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #adb5bd;
    box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.25);
    transform: translateY(-1px);
}

/* Badge Enhancements */
.badge {
    border-radius: 8px;
    font-weight: 500;
}

/* Responsive Typography */
@media (max-width: 576px) {
    h3 {
        font-size: 1.5rem;
    }
    
    h5 {
        font-size: 1.1rem;
    }
    
    .lead {
        font-size: 1rem;
    }
}

/* Touch-friendly Elements */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .list-group-item {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    transform: none !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .list-group-item {
        background-color: #2d2d2d;
        border-color: #495057;
        color: #ffffff;
    }
    
    .list-group-item:hover {
        background-color: #3d3d3d;
    }
    
    .form-control {
        background-color: #2d2d2d;
        border-color: #495057;
        color: #ffffff;
    }
    
    .form-control:focus {
        background-color: #2d2d2d;
        color: #ffffff;
    }
}

/* Animation for new words */
.list-group-item {
    animation: slideInUp 0.3s ease-out;
}

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

/* Word List Card Styles */
.card .list-group-item {
    border-left: none;
    border-right: none;
    padding: 12px 20px;
    transition: background-color 0.2s ease;
}

.card .list-group-item:hover {
    background-color: #f8f9fa;
}

.card .list-group-item:first-child {
    border-top: none;
}

.card .list-group-item:last-child {
    border-bottom: none;
}

/* 최신 단어 강조 */
.card .list-group-item:first-child {
    background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
    border-left: 4px solid #adb5bd;
}

.card .list-group-item:first-child:hover {
    background: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 100%);
}

/* Side-by-side layout adjustments */
@media (min-width: 992px) {
    .col-lg-6 {
        margin-bottom: 1rem;
    }
    
    .card {
        height: fit-content;
    }
}

/* Mobile layout adjustments */
@media (max-width: 991px) {
    .col-12 {
        margin-bottom: 1rem;
    }
}

/* Disabled Form Styles */
.disabled-form {
    opacity: 0.7;
    pointer-events: none;
}

.disabled-form .form-control {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.disabled-form .btn {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed;
}

.disabled-form .btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Alert link styles */
.alert-link {
    font-weight: 600;
    text-decoration: none;
}

.alert-link:hover {
    text-decoration: underline;
}