/* Modern Bus Card Design - Profile Card Style */

/* Bus Grid Layout */
.bus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Bus Cards */
.bus-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 1.8rem;
    animation: fadeIn 0.5s ease forwards;
    max-width: 320px;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transform-origin: center bottom;
}

[data-theme="dark"] .bus-card {
    background-color: #2a2a35;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.bus-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .bus-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

/* Bus Number Display */
.bus-number {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 3.5rem;
    font-weight: 700;
    color: #333;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: -1px;
}

/* Bus Type Badge */
.bus-type-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #333;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(5px);
}

/* Bus Profile Pic Section */
.bus-profile-pic {
    position: relative;
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    transition: all 0.5s ease;
}

.bus-profile-pic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
                rgba(0, 0, 0, 0) 0%,
                rgba(0, 0, 0, 0.2) 100%);
    z-index: 1;
    transition: all 0.3s ease;
}

.bus-card:hover .bus-profile-pic::before {
    background: linear-gradient(to bottom, 
                rgba(0, 0, 0, 0) 0%,
                rgba(0, 0, 0, 0.3) 100%);
}

/* Bus Info Section */
.bus-info {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(249,250,251,0.5) 100%);
}

[data-theme="dark"] .bus-info {
    background: linear-gradient(180deg, rgba(42,42,53,0) 0%, rgba(35,35,45,0.5) 100%);
}

.bus-info h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
    display: inline-block;
}

.bus-info h3::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #4285f4, #34a853);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.bus-card:hover .bus-info h3::after {
    width: 60px;
}

[data-theme="dark"] .bus-info h3 {
    color: #ffffff;
}

[data-theme="dark"] .bus-info h3::after {
    background: linear-gradient(90deg, #4285f4, #34a853);
}

.bus-info p {
    margin: 0 0 1.2rem 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

[data-theme="dark"] .bus-info p {
    color: #cccccc;
}

/* Bus Metadata */
.bus-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.bus-meta span {
    display: inline-block;
    font-size: 0.85rem;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.bus-meta span:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bus-meta span:nth-child(1) {
    background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
    color: #006064;
}

.bus-meta span:nth-child(2) {
    background: linear-gradient(135deg, #e8eaf6, #c5cae9);
    color: #1a237e;
}

.bus-meta span:nth-child(3) {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: #4a148c;
}

/* Bus Actions */
.bus-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: auto;
}

.bus-actions .feature-btn {
    flex: 1;
    padding: 0.7rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-height: 40px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.bus-actions .feature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.bus-actions .feature-btn:active {
    transform: translateY(1px);
}

.bus-actions .feature-btn i {
    font-size: 0.9rem;
}

/* Button Styles */
.view-route {
    background-color: #3498db;
    color: white;
}

.view-route:hover {
    background-color: #2980b9;
}

.remove-btn {
    background-color: #e74c3c;
    color: white;
}

.remove-btn:hover {
    background-color: #c0392b;
}

.share-btn {
    background-color: #2ecc71;
    color: white;
}

.share-btn:hover {
    background-color: #27ae60;
}

/* View Profile Button */
.view-profile-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: auto;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #4285f4, #34a853);
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.view-profile-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #34a853, #4285f4);
    transition: all 0.5s ease;
    z-index: -1;
    border-radius: 30px;
}

.view-profile-btn:hover {
    color: #fff;
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.view-profile-btn:hover::before {
    width: 100%;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .bus-card {
        margin-bottom: 1.5rem;
    }
    
    .bus-profile-pic {
        height: 180px;
    }
    
    .bus-info {
        padding: 1.2rem;
    }
    
    .bus-info h3 {
        font-size: 1.2rem;
    }
    
    .bus-meta span {
        font-size: 0.8rem;
        padding: 0.4rem 0.9rem;
    }
    
    .view-profile-btn {
        padding: 0.7rem 1.3rem;
    }
}

@media (max-width: 480px) {
    .bus-profile-pic {
        height: 160px;
    }
    
    .bus-info {
        padding: 1rem;
    }
    
    .bus-info h3 {
        font-size: 1.1rem;
    }
    
    .bus-info p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .bus-meta {
        gap: 0.6rem;
        margin-bottom: 1.2rem;
    }
    
    .bus-meta span {
        font-size: 0.75rem;
        padding: 0.35rem 0.8rem;
    }
    
    .view-profile-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Animation for card appearance */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add a shimmer effect for loading state */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.bus-card.loading .bus-profile-pic {
    background: #f6f7f8;
    background: linear-gradient(to right, #f6f7f8 8%, #edeef1 18%, #f6f7f8 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite linear;
}

/* Add a badge for featured buses */
.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 3;
    box-shadow: 0 4px 10px rgba(255, 87, 34, 0.3);
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 120px;
    margin: 2rem 0;
}

.loading-spinner i {
    color: var(--accent-color);
    font-size: 2rem;
    opacity: 0.7;
    animation: spin 1.2s infinite cubic-bezier(0.5, 0.1, 0.5, 0.9);
}

@keyframes spin {
    0% {
        transform: rotate(0deg) scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: rotate(180deg) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: rotate(360deg) scale(0.8);
        opacity: 0.3;
    }
}

/* Error message */
.error-message {
    text-align: center;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 2rem auto;
    max-width: 500px;
}

[data-theme="dark"] .error-message {
    background-color: #2a2a35;
}

.error-message i {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-message h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

[data-theme="dark"] .error-message h3 {
    color: #ffffff;
}

.error-message p {
    color: #666;
    margin-bottom: 1.5rem;
}

[data-theme="dark"] .error-message p {
    color: #cccccc;
}

.error-message .feature-btn {
    background-color: #4e6af3;
    color: white;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message .feature-btn:hover {
    transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .bus-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.2rem;
    }
    
    .bus-header {
        height: 160px;
    }
    
    .bus-info {
        padding: 1.2rem;
    }
    
    .bus-actions .feature-btn {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* Mobile-specific fixes */
@media (max-width: 480px) {
    .bus-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 0.8rem;
    }
    
    .bus-card {
        display: flex;
        flex-direction: column;
        min-height: auto;
    }
    
    .bus-header {
        width: 100%;
        height: 150px;
    }
    
    .bus-info {
        width: 100%;
        padding: 1.2rem;
    }
    
    .bus-info h3 {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }
    
    .bus-info p {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }
    
    .bus-meta {
        margin-bottom: 1.2rem;
    }
    
    .bus-meta span {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }
    
    .bus-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.6rem;
    }
    
    .bus-actions .feature-btn {
        padding: 0.6rem 0.4rem;
        font-size: 0.75rem;
        min-height: 36px;
    }
    
    .bus-actions .feature-btn i {
        font-size: 0.8rem;
    }
}

/* Modal styles for bus details */
.modal .bus-header {
    height: 200px;
}
