/* K12 School Cards - LoveForm-Style */

.school-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
    background: white;
}

.school-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15) !important;
}

/* Card Image */
.card-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.school-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.school-card:hover .school-card-image {
    transform: scale(1.05);
}

/* Badges */
.school-card .badge {
    font-size: 0.7rem;
    border-radius: 6px;
    font-weight: 500;
}

/* Heart Button */
.heart-btn {
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

.heart-btn:hover {
    background: rgba(0,0,0,0.5);
    transform: scale(1.1);
}

.heart-btn.favorited {
    color: #e53e3e !important;
}

.heart-btn.favorited i {
    animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Card Body */
.school-card .card-body {
    padding: 1.25rem;
}

.school-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rating Stars */
.stars {
    display: inline-flex;
    gap: 1px;
}

.stars i {
    font-size: 0.75rem;
}

.rating-number {
    font-size: 0.875rem;
    color: #2d3748;
}

/* School Stats */
.school-stats {
    background: #f7fafc;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.75rem 0;
}

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

.stat-number {
    font-weight: 600;
    color: #2d3748;
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: #718096;
    line-height: 1.2;
}

/* Program Text */
.program-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Programs Pills */
.programs-pills .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.programs-pills .bg-light {
    background-color: #edf2f7 !important;
    color: #4a5568 !important;
}

/* Action Buttons */
.card-actions .btn {
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
}

.card-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.card-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.card-actions .btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.card-actions .btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
}

/* Quick Actions */
.quick-actions {
    font-size: 0.75rem;
}

.quick-actions .btn-link {
    color: #718096;
    text-decoration: none;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s ease-in-out;
}

.quick-actions .btn-link:hover {
    color: #667eea;
    background-color: #f7fafc;
}

/* Distance Info */
.distance-info {
    color: #667eea;
    font-weight: 500;
}

/* Loading State */
.card-loading {
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    z-index: 10;
}

/* Compact Card Variant */
.school-card-compact {
    border-radius: 8px;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.school-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.school-card-compact .card-body {
    padding: 0.75rem;
}

.school-card-compact h6 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.school-card-compact .stars {
    gap: 1px;
}

.school-card-compact .stars i {
    font-size: 0.7rem;
}

.school-card-compact .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Featured Card Style */
.school-card.featured {
    border: 2px solid #fbd38d;
    position: relative;
}

.school-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ed8936 0%, #fbd38d 100%);
    z-index: 1;
}

/* Verified Card Style */
.school-card.verified {
    border-left: 4px solid #48bb78;
}

/* Image Fallback */
.school-card-image[src=""], 
.school-card-image[src="/images/ui/default-school.jpg"] {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    position: relative;
}

.school-card-image[src=""]:after,
.school-card-image[src="/images/ui/default-school.jpg"]:after {
    content: '\f19c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #a0aec0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-image-container {
        height: 160px;
    }
    
    .school-card .card-body {
        padding: 1rem;
    }
    
    .school-name {
        font-size: 1rem;
    }
    
    .school-stats {
        padding: 0.5rem;
    }
    
    .stat-number {
        font-size: 0.75rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .card-actions .row {
        gap: 0.5rem;
    }
    
    .card-actions .col-8,
    .card-actions .col-4 {
        flex: 1;
    }
}

@media (max-width: 576px) {
    .card-image-container {
        height: 140px;
    }
    
    .school-card .card-body {
        padding: 0.75rem;
    }
    
    .school-stats .row {
        text-align: center;
    }
    
    .school-stats .col-4 {
        margin-bottom: 0.5rem;
    }
    
    .card-actions .row {
        flex-direction: column;
    }
    
    .card-actions .col-8,
    .card-actions .col-4 {
        width: 100%;
    }
}

/* Animation for cards entering view */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.school-card.animate-in {
    animation: fadeInUp 0.4s ease-out forwards;
}

.school-card.animate-in:nth-child(1) { animation-delay: 0.1s; }
.school-card.animate-in:nth-child(2) { animation-delay: 0.2s; }
.school-card.animate-in:nth-child(3) { animation-delay: 0.3s; }
.school-card.animate-in:nth-child(4) { animation-delay: 0.4s; }
.school-card.animate-in:nth-child(5) { animation-delay: 0.5s; }
.school-card.animate-in:nth-child(6) { animation-delay: 0.6s; }