/* Cards - Universal Reusable Card Components */

/* ========================================
   BASE CARD STRUCTURE
   ======================================== */

.card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #f3f4f6;
    overflow: hidden;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}

/* Card Header */
.card__header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card__header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card__header h2 i {
    color: #67a552;
    font-size: 20px;
}

.card__header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card__header h3 i {
    color: #67a552;
    font-size: 18px;
}

/* Card Actions (buttons in header) */
.card__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Card Meta (info text in header) */
.card__meta {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.card__meta strong {
    color: #1f2937;
    font-weight: 600;
}

/* Card Body */
.card__body {
    padding: 24px;
    flex: 1;
}

.card__body--no-padding {
    padding: 0;
}

/* Card Footer */
.card__footer {
    padding: 16px 24px;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

/* ========================================
   CARD MODIFIERS
   ======================================== */

/* Full Width Card (spans all columns in grid) */
.card--full {
    grid-column: 1 / -1;
}

/* Card with gradient header */
.card--gradient-header .card__header {
    background: linear-gradient(135deg, #67a552 0%, #5a8f47 100%);
    border-bottom: none;
}

.card--gradient-header .card__header h2,
.card--gradient-header .card__header h3 {
    color: #ffffff;
}

.card--gradient-header .card__header h2 i,
.card--gradient-header .card__header h3 i {
    color: #ffffff;
}

/* Compact card (less padding) */
.card--compact .card__header {
    padding: 16px 20px;
}

.card--compact .card__body {
    padding: 20px;
}

.card--compact .card__footer {
    padding: 12px 20px;
}

/* Borderless card */
.card--borderless {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ========================================
   CARD GRID LAYOUTS
   ======================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.card-grid--narrow {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
}

/* ========================================
   LEGACY SUPPORT (for backward compatibility)
   ======================================== */

/* Dashboard Card (alias for .card) */
.dashboard-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #f3f4f6;
    overflow: hidden;
    margin-bottom: 30px;
}

.dashboard-card--full {
    grid-column: 1 / -1;
}

.dashboard-card__header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-card__header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-card__header h2 i {
    color: #67a552;
    font-size: 20px;
}

.dashboard-card__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dashboard-card__body {
    padding: 24px;
}

.dashboard-card__body--no-padding {
    padding: 0;
}

.dashboard-card__footer {
    padding: 16px 24px;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 991px) {
    .card-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .card__header,
    .dashboard-card__header {
        padding: 16px;
    }

    .card__body,
    .dashboard-card__body {
        padding: 16px;
    }

    .card__footer,
    .dashboard-card__footer {
        padding: 12px 16px;
    }
}

@media (max-width: 767px) {
    .card__header,
    .dashboard-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card__actions,
    .dashboard-card__actions {
        width: 100%;
        flex-direction: column;
    }

    .card__actions .btn,
    .dashboard-card__actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   SERVICE CARDS
   ======================================== */

.service-cards {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.service-cards .wide {
    grid-template-columns: auto;
}

.service-cards li {
    margin: 0;
}

.service-cards li a {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    box-sizing: border-box;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.04);
}

.service-cards li a:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #9ca3af;
    transition: all 0.3s ease;
}

.service-cards li a:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: #9ca3af;
    background: linear-gradient(135deg, #ffffff 0%, rgba(156, 163, 175, 0.02) 100%);
}

.service-cards li a:hover:before {
    width: 6px;
}

.service-cards li a strong {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    word-break: break-word;
}

.service-cards li a .description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* Active Service Card */
.service-cards .service-card-active a:before {
    background: #67a552;
}

.service-cards .service-card-active a:hover {
    border-color: #67a552;
    background: linear-gradient(135deg, #ffffff 0%, rgba(103, 165, 82, 0.02) 100%);
}

/* Suspended Service Card */
.service-cards .service-card-suspended a:before {
    background: #f59e0b;
}

.service-cards .service-card-suspended a:hover {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, rgba(245, 158, 11, 0.02) 100%);
}

.service-cards .service-card-suspended a .description {
    color: #d97706;
    font-weight: 500;
}

/* Pending Service Card */
.service-cards .service-card-pending a:before {
    background: #3b82f6;
}

.service-cards .service-card-pending a:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, rgba(59, 130, 246, 0.02) 100%);
}

.service-cards .service-card-pending a .description {
    color: #2563eb;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 991px) {
    .service-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .service-cards li a {
        padding: 20px;
        gap: 10px;
    }

    .service-cards li a strong {
        font-size: 15px;
    }

    .service-cards li a .description {
        font-size: 13px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .card,
    .dashboard-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        page-break-inside: avoid;
    }

    .card__header .btn,
    .card__actions,
    .dashboard-card__header .btn,
    .dashboard-card__actions {
        display: none;
    }
}
