/* Clash Info - Modern UI Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 153, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 204, 0, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    z-index: -1;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ff9900, #ffcc00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -2px;
}

.subtitle {
    font-size: 1.2rem;
    color: #b8b8b8;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid #333;
    border-radius: 2rem;
    background: #1a1a1a;
    color: #ffffff;
    transition: all 0.3s ease;
    font-family: inherit;
}

#searchInput:focus {
    outline: none;
    border-color: #ff9900;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
    background: #222;
}

#searchInput::placeholder {
    color: #666;
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ff9900, #ffcc00);
    border: none;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
}

/* Filter Buttons */
.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 2rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #ff9900, #ffcc00);
    border-color: #ff9900;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.2);
}

/* Town Hall Grid */
.townhall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

/* Town Hall Cards */
.townhall-card {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.townhall-card:hover::before {
    left: 100%;
}

.townhall-card:hover {
    transform: translateY(-8px);
    border-color: #ff9900;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 153, 0, 0.1);
    background: #222;
}

.townhall-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.townhall-level {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff9900, #ffcc00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.townhall-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    border: 2px solid #333;
    transition: all 0.3s ease;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
}

.townhall-card:hover .townhall-image {
    border-color: #ff9900;
    box-shadow: 0 0 15px rgba(255, 153, 0, 0.3);
}

.townhall-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: #111;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #333;
    text-align: center;
    transition: all 0.3s ease;
}

.townhall-card:hover .stat-item {
    border-color: #444;
    background: #1a1a1a;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff9900;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.townhall-features {
    background: #111;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #333;
    margin-top: 1rem;
}

.features-title {
    font-size: 0.9rem;
    color: #ff9900;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.features-list {
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.4;
}

/* Detail Pages */
.detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #1a1a1a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    border: 2px solid #333;
}

.back-btn:hover {
    background: linear-gradient(135deg, #ff9900, #ffcc00);
    color: #000;
    border-color: #ff9900;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.2);
}

.detail-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem;
    background: #1a1a1a;
    border-radius: 2rem;
    border: 2px solid #333;
}

.detail-header h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.detail-header .subtitle {
    font-size: 1.4rem;
    color: #ff9900;
}

.detail-th-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    border-radius: 15px;
    border: 3px solid #ff9900;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.3);
}

.detail-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.detail-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 153, 0, 0.1);
    border-radius: 12px;
    border: 1px solid #ff9900;
    min-width: 120px;
}

.detail-stat .stat-label {
    font-size: 0.8rem;
    color: #ccc;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff9900;
}

/* Override for old detail-content structure */
.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
    max-width: none !important;
}

@media (max-width: 1200px) {
    .detail-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.content-section {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.content-section:hover {
    border-color: #444;
    background: #222;
}

.content-section h3 {
    color: #ff9900;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 2px solid #333;
    transition: all 0.3s ease;
}

.detail-section:hover {
    border-color: #444;
    background: #222;
}

.detail-section h3 {
    color: #ff9900;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-list {
    list-style: none;
}

.detail-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-list li:last-child {
    border-bottom: none;
}

.detail-list .item-name {
    color: #ffffff;
    font-weight: 500;
}

.detail-list .item-value {
    color: #ff9900;
    font-weight: 600;
}

.new-section {
    border: 2px solid #ff9900 !important;
    background: rgba(255, 153, 0, 0.05) !important;
}

.new-section h3 {
    background: linear-gradient(135deg, #ff9900, #ffcc00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .townhall-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .townhall-card {
        padding: 1.5rem;
    }
    
    .filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .townhall-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .townhall-level {
        font-size: 2rem;
    }
    
    .townhall-icon {
        font-size: 2.5rem;
    }
    
    .detail-header h1 {
        font-size: 2.5rem;
    }
    
    .detail-section {
        padding: 1.5rem;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #ff9900;
}

.error {
    text-align: center;
    padding: 3rem;
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 1.5rem;
    margin: 2rem 0;
    border: 2px solid rgba(255, 71, 87, 0.2);
}

/* Utility Classes */
.hidden {
    display: none;
}

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

.mb-2 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}