/* =========================================================
   Credentials Grid Layout
   ========================================================= */

/* Grid container
   Responsive grid with auto-fill columns */
.credentials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* =========================================================
   Card Styling
   ========================================================= */

.credential-card {
    background-color: var(--secondary-color);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.credential-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    background-color: #2a2a2a;
}

/* =========================================================
   Image Section
   ========================================================= */

/* Clickable container opening modal */
.card-image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    background-color: #000;
    cursor: pointer;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: transform 0.5s ease, opacity 0.3s ease, filter 0.5s ease;
    filter: grayscale(100%);
}

.card-image-container:hover .card-image {
    transform: scale(1.02);
    opacity: 1;
    cursor: pointer;
}

/* Overlay icon styling
   Hidden by default on desktop, appears on hover */
.card-overlay-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
    font-size: 0.9rem;
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

/* Desktop Hover State */
.card-image-container:hover .card-overlay-icon {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================================
   Content Section
   ========================================================= */

.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Title & Header */
.card-title {
    color: var(--white-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Organization row */
.card-subtitle-row {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.card-org-link {
    color: var(--secondary-white-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.card-org-link:hover {
    color: var(--white-color);
    border-bottom-color: var(--white-color);
}

/* Metadata (Date | Type) */
.card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.card-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Description text
   Flex-grow pushes footer down */
.card-description {
    color: var(--secondary-white-color);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.85;
    flex-grow: 1;
}

/* Footer (Actions) */
.card-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Action Buttons - Handled by Global Standard Styles */
.action-btn {
    flex: 1;
    min-width: 100px;
}


/* =========================================================
   Modal Overrides
   ========================================================= */

.modal-content {
    background-color: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--white-color) !important;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* .btn-close handled by global modals.css */

/* =========================================================
   Responsive Adjustments
   ========================================================= */

@media (max-width: 768px) {
    .credentials-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        margin-left: 10px;
        margin-right: 10px;
    }

    /* Persistent overlay icon on mobile */
    .card-overlay-icon {
        opacity: 1;
        transform: translateY(0);
        background-color: rgba(0, 0, 0, 0.7);
    }
}


/* Gallery and animation styles handled by modals.css */