/**
 * Card Component Styles
 * Styles for all card-based UI elements
 */

/* Base Card Styles */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

.card-title {
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #333;
}

.card-subtitle {
    margin-top: -0.375rem;
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.card-text {
    color: #6c757d;
    margin-bottom: 1rem;
}

.card-text:last-child {
    margin-bottom: 0;
}

.card-link {
    color: #3D7A67;
    text-decoration: none;
}

.card-link:hover {
    color: #2f5c4e;
    text-decoration: underline;
}

.card-link + .card-link {
    margin-left: 1.25rem;
}

/* Card Header and Footer */
.card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header:first-child {
    border-radius: calc(0.375rem - 1px) calc(0.375rem - 1px) 0 0;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

.card-footer:last-child {
    border-radius: 0 0 calc(0.375rem - 1px) calc(0.375rem - 1px);
}

/* Card Image */
.card-img-top {
    width: 100%;
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
    object-fit: cover;
}

.card-img-top-container {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-img-bottom {
    width: 100%;
    border-bottom-right-radius: calc(0.375rem - 1px);
    border-bottom-left-radius: calc(0.375rem - 1px);
}

.card-img-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 1.25rem;
    border-radius: calc(0.375rem - 1px);
}

/* Card Groups */
.card-group {
    display: flex;
    flex-flow: row wrap;
}

.card-group > .card {
    flex: 1 0 0%;
    margin-bottom: 0;
}

.card-group > .card + .card {
    margin-left: 0;
    border-left: 0;
}

.card-group > .card:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.card-group > .card:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Card Decks */
.card-deck {
    display: flex;
    flex-flow: row wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.card-deck .card {
    flex: 1 0 0%;
    margin-right: 15px;
    margin-bottom: 0;
    margin-left: 15px;
}

/* Card Columns */
.card-columns {
    column-count: 3;
    column-gap: 1.25rem;
    orphans: 1;
    widows: 1;
}

.card-columns .card {
    display: inline-block;
    width: 100%;
    margin-bottom: 0.75rem;
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-description {
    height: 60px;
    overflow: hidden;
    position: relative;
}

.product-description:after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
}

.floating-categories {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 90%;
}

.floating-category {
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    backdrop-filter: blur(2px);
}

/* Order Cards */
.order-card {
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-status-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
}

.order-card-inner {
    padding: 1.5rem 1.5rem 1.5rem 2rem;
}

/* Admin Dashboard Cards */
.stats-card {
    overflow: hidden;
    position: relative;
    animation: fadeIn 0.5s ease forwards;
    transition: all 0.3s ease;
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card.border-left-primary {
    border-left: 4px solid #4e73df !important;
}

.stats-card.border-left-success {
    border-left: 4px solid #1cc88a !important;
}

.stats-card.border-left-warning {
    border-left: 4px solid #f6c23e !important;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Content Cards */
.content-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    height: 100%;
}

.content-card .card-header {
    padding: 1.8rem 2rem;
    border-bottom: 1px solid #f0f0f0;
    background-color: #ffffff;
}

.content-card .card-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: #333;
}

.content-card .card-header h2 i {
    color: #3D7A67;
}

.content-card .card-body {
    padding: 2rem;
    background-color: #fafafa;
}

/* Profile Cards */
.profile-sidebar {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    position: sticky;
    top: 100px;
}

.user-card {
    background: linear-gradient(135deg, #8bc34a 0%, #4caf50 100%);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
}

/* Filter Cards */
.filter-panel {
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.filter-panel:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.filter-options {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Cart Item Cards */
.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 120px;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .card-columns {
        column-count: 2;
    }

    .order-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .card-columns {
        column-count: 1;
    }

    .card-body {
        padding: 1rem;
    }

    .product-card:hover {
        transform: translateY(-3px);
    }
}

@media (max-width: 575.98px) {
    .content-card .card-header,
    .content-card .card-body {
        padding: 1.5rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .order-card-inner {
        padding: 1rem;
    }
}