/* building-details.css */

/* --- Variables & Theme Overrides --- */
:root {
    --glass-bg: rgba(30, 30, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --accent-glow: 0 0 20px rgba(227, 199, 112, 0.3);

    --gradient-gold: linear-gradient(135deg, #E3C770 0%, #a88b32 100%);
    --gradient-dark: linear-gradient(145deg, #1e1e1e 0%, #121212 100%);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(227, 199, 112, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(227, 199, 112, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(227, 199, 112, 0);
    }
}

/* --- Layout Components --- */

.detail-view-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-md);
    animation: fadeInUp 0.4s ease-out;
}

/* Back Button styling update */
.back-nav {
    margin-bottom: var(--spacing-lg);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-back:hover {
    color: var(--primary);
    transform: translateX(-5px);
}

/* --- Hero Section --- */
.building-hero {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    /* More rounded */
    padding: 40px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--glass-shadow);
    margin-bottom: var(--spacing-xl);
}

/* Dynamic background glow based on building state */
.building-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(227, 199, 112, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 30px;
    align-items: flex-start;
}

/* Large Icon Container */
.hero-icon-wrapper {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.hero-details h1 {
    font-size: 3rem;
    margin-bottom: 5px;
    background: linear-gradient(to right, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.building-badges {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.badge-level {
    background: var(--gradient-gold);
    color: #1a1a1a;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(227, 199, 112, 0.3);
}

.badge-status {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-status.inactive {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 20px;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
}

.hero-stat-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.hero-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

.hero-stat-value.cost {
    color: #e74c3c;
}

.hero-stat-value.eff {
    color: #2ecc71;
}

/* Demo Button */
.btn-demolish-ghost {
    background: transparent;
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: rgba(231, 76, 60, 0.8);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    transition: all 0.2s;
}

.btn-demolish-ghost:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: #e74c3c;
}

/* --- Upgrade Card Specifics --- */
.upgrade-banner {
    background: linear-gradient(90deg, #1e1e1e 0%, #252525 100%);
    border: 1px solid var(--primary);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(227, 199, 112, 0.05);
}

.upgrade-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.upgrade-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.upgrade-benefits {
    display: flex;
    gap: 20px;
    margin-top: 12px;
}

.benefit-pill {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-upgrade-action {
    background: var(--gradient-gold);
    color: #1a1a1a;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(227, 199, 112, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: pulse-glow 3s infinite;
}

.btn-upgrade-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(227, 199, 112, 0.6);
}

/* --- Content Grid --- */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* Section Cards */
.glass-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header-styled {
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-styled h2 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body-styled {
    padding: 20px;
    flex: 1;
}

/* Employee & Machine List Items */
.list-item-premium {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.list-item-premium:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.item-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.item-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 2px;
}

.item-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.item-stats-row {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.mini-stat {
    display: flex;
    flex-direction: column;
}

.mini-stat label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mini-stat span {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Controls */
.control-group {
    display: flex;
    gap: 8px;
}

.inp-premium {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px;
    border-radius: 8px;
    width: 60px;
    text-align: center;
    font-weight: 600;
}

.inp-premium:focus {
    border-color: var(--primary);
    outline: none;
}

.btn-premium-sm {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action-primary {
    background: var(--primary);
    color: #1a1a1a;
}

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

.btn-action-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
}

.btn-action-outline:hover {
    border-color: #fff;
    color: #fff;
}

/* Storage specific */
.storage-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #f1c40f 100%);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-icon-wrapper {
        margin: 0 auto;
    }

    .hero-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .building-badges {
        justify-content: center;
    }

    .upgrade-content {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .btn-upgrade-action {
        width: 100%;
    }
}