

/* Digimoor Tools Plugin Styles */

/* Reset & Container */
.dm-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #334155;
    padding: 20px;
    box-sizing: border-box;
}

.dm-container * {
    box-sizing: border-box;
}

/* Grid Layout */
.dm-grid {
    display: grid;
    /* Reduced minmax from 300px to 220px (~70% size) */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    width: 100%;
    margin-top: 20px;
}

/* Card Design */
.dm-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative; /* Essential for stretched link */
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

/* Card Image Area - Height reduced */
.dm-card-image {
    height: 110px; /* Reduced from 160px */
    width: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

/* Card Content Body - Padding reduced */
.dm-card-content {
    padding: 16px; /* Reduced from 24px */
    padding-top: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Floating Logo on Card - Scaled down */
.dm-card-logo-wrapper {
    margin-top: -25px; /* Scaled pull up */
    margin-bottom: 12px;
    z-index: 2;
    position: relative; /* Ensure above stretched link */
    pointer-events: none; /* Let clicks pass through if needed, but wrapper is just structural */
}

.dm-card-logo {
    width: 50px; /* Scaled from 72px */
    height: 50px;
    border-radius: 8px; /* Scaled radius */
    object-fit: cover;
    background: #ffffff;
    border: 3px solid #ffffff; /* Thinner border */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dm-card-logo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #f8fafc;
    border: 3px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #cbd5e1;
    font-size: 18px; /* Smaller font */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Type Tag - Smaller */
.dm-type-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

/* Titles - Smaller */
.dm-card-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px; /* Reduced from 18px */
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

/* Description Text - Smaller */
.dm-card-content p {
    font-size: 13px; /* Reduced from 14px */
    line-height: 1.5;
    color: #475569;
    margin-bottom: 16px;
    flex-grow: 1;
}

/* Card Footer */
.dm-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px; /* Reduced */
    margin-top: auto;
    position: relative; /* Context for z-index */
}

/* Links */
.dm-link {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

/* Stretched Link Logic: Makes the parent card clickable */
.dm-stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

.dm-link:hover {
    text-decoration: underline;
}

/* External Link Button */
.dm-icon-link {
    width: 28px; /* Smaller icon button */
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.2s;
    background: #f8fafc;
    position: relative; /* Important */
    z-index: 2; /* Must be higher than stretched link z-index (1) */
}

.dm-icon-link:hover {
    color: #2563eb;
    background: #eff6ff;
}

/* =========================================
   Detail View Styling
   ========================================= */

.dm-detail-view {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.dm-back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.dm-back-link:hover {
    text-decoration: underline;
    color: #0f172a;
}

.dm-detail-header {
    border-bottom: 1px solid #f1f5f9;
}

.dm-detail-banner {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    background-color: #e2e8f0;
}

.dm-detail-head-content {
    padding: 0 32px 32px 32px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    position: relative;
}

.dm-detail-logo {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    border: 4px solid #fff;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-top: -50px;
    object-fit: cover;
    flex-shrink: 0;
}

.dm-detail-meta {
    padding-top: 16px;
    flex: 1;
}

.dm-detail-meta h1 {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 8px 0;
    line-height: 1.2;
}

.dm-badge {
    background: #e0e7ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    text-transform: uppercase;
}

.dm-version {
    font-family: monospace;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
}

.dm-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dm-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-block;
}

.dm-btn-primary {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #2563eb;
}
.dm-btn-primary:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.dm-btn-secondary {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.dm-btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.dm-content {
    padding: 32px;
    font-size: 16px;
    line-height: 1.7;
    color: #334155;
}

.dm-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .dm-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .dm-detail-head-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -50px;
    }
    .dm-detail-logo {
        margin-top: 0;
    }
    .dm-actions {
        justify-content: center;
    }
}
