/**
 * Card Components
 * Modern card designs for various content types
 */

/* Base Card */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-card-hover);
}

/* Title Card (Hero) */
.title-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--bg-title-card) 0%, var(--color-primary) 100%);
    padding: var(--space-xl);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-2xl);
    min-height: 140px;
    position: relative;
    overflow: hidden;
}

.title-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

.title-card-logo {
    flex-shrink: 0;
    margin-right: var(--space-xl);
    z-index: 1;
}

.title-card-logo img {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
}

.title-card-content {
    flex: 1;
    z-index: 1;
}

.title-card-content h1 {
    color: var(--text-light);
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-sm);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.title-card-content h2 {
    color: rgba(255, 255, 255, 0.95);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Building/Status Cards */
.building-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.building-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
}

.building-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--color-secondary);
    transition: all var(--transition-base);
}

.building-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.building-card.selected {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-xl);
}

.building-card.selected::before {
    height: 8px;
    background: var(--color-accent);
}

/* Status variants */
.building-card.status-open::before {
    background: var(--color-success);
}

.building-card.status-closed::before {
    background: var(--color-danger);
}

.building-card.status-open {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(157, 255, 157, 0.05) 100%);
}

.building-card.status-closed {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(252, 84, 100, 0.05) 100%);
    opacity: 0.7;
    cursor: not-allowed;
}

.building-card.status-closed:hover {
    transform: none;
}

.building-name {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: block;
}

.building-status {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

.building-card.status-open .building-status {
    background: var(--bg-status-open);
    color: #1a5a1a;
}

.building-card.status-closed .building-status {
    background: var(--bg-status-closed);
    color: var(--text-light);
}

.building-capacity {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: var(--space-md) 0;
}

.capacity-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: block;
    margin-bottom: var(--space-xs);
}

.building-appointments {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.appointment-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: block;
    margin-bottom: var(--space-xs);
}

.appointment-count {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-accent);
}

/* Info Card */
.info-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-accent);
}

.info-card.success {
    border-left-color: var(--color-success);
}

.info-card.warning {
    border-left-color: var(--color-warning);
}

.info-card.danger {
    border-left-color: var(--color-danger);
}

/* Responsive Cards */
@media (max-width: 1024px) {
    .building-cards {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    .title-card {
        flex-direction: column;
        text-align: center;
        padding: var(--space-lg);
    }
    
    .title-card-logo {
        margin-right: 0;
        margin-bottom: var(--space-md);
    }
    
    .title-card-logo img {
        height: 60px;
    }
    
    .title-card-content h1 {
        font-size: var(--font-size-2xl);
    }
    
    .title-card-content h2 {
        font-size: var(--font-size-lg);
    }
    
    .building-cards {
        grid-template-columns: 1fr;
    }
    
    .building-card {
        padding: var(--space-lg);
    }
}
