/* ============================================
   Frontend Download Package Styles
   ============================================ */

:root {
    --wvdp-primary: #1e293b;
    --wvdp-primary-hover: #334155;
    --wvdp-bg-card: #f8f9fa;
    --wvdp-text-primary: #1a1a1a;
    --wvdp-text-secondary: #666666;
    --wvdp-border: #e5e7eb;
    --wvdp-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --wvdp-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --wvdp-radius: 8px;
    --wvdp-transition: all 0.3s ease;
}

/* Main Wrapper */
.wvdp-downloads-wrapper {
    margin: 30px 0;
}

.wvdp-downloads-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Grid Layout */
.wvdp-layout-grid .wvdp-downloads-container {
    display: grid;
    gap: 20px;
}

.wvdp-layout-grid.wvdp-columns-2 .wvdp-downloads-container {
    grid-template-columns: repeat(2, 1fr);
}

.wvdp-layout-grid.wvdp-columns-3 .wvdp-downloads-container {
    grid-template-columns: repeat(3, 1fr);
}

.wvdp-layout-grid.wvdp-columns-4 .wvdp-downloads-container {
    grid-template-columns: repeat(4, 1fr);
}

/* Download Item Card - Vertical Layout (Bootstrap-like) */
.wvdp-download-item {
    display: block;
}

.wvdp-download-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.wvdp-download-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: rgb(217 45 32) !important;
}

.wvdp-download-card:hover .wvdp-download-btn {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: white !important;
}

/* Header: Icon + Category Badge */
.wvdp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.wvdp-download-icon {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wvdp-icon-pdf {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.wvdp-icon-doc {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.wvdp-icon-xls {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.wvdp-icon-zip {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.wvdp-icon-video {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.wvdp-icon-default {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.wvdp-download-icon svg {
    width: 24px;
    height: 24px;
}

.wvdp-category-badge {
    background: #eff6ff;
    color: #2563eb;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 0.71rem;
    font-weight: 500;
    white-space: nowrap;
    height: auto;
}

/* Title with Stretched Link */
.wvdp-download-title {
    margin: 0 0 12px 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

.wvdp-download-title a {
    color: #1f2937;
    text-decoration: none;
}

.wvdp-download-title a:hover {
    color: #1f2937;
    text-decoration: none;
}

.wvdp-stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* Description */
.wvdp-download-description {
    margin: 0 0 16px 0;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
    flex-grow: 1;
}

/* Footer */
.wvdp-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.wvdp-download-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: rgb(100, 116, 139);
}

.wvdp-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.wvdp-meta-icon {
    width: 14px;
    height: 14px;
}

/* Download Button - Full Width */
.wvdp-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: #f8fafc;
    color: #1e293b;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.wvdp-download-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    text-decoration: none;
}

.wvdp-btn-icon {
    width: 16px;
    height: 16px;
}

/* No Downloads Message */
.wvdp-no-downloads {
    text-align: center;
    padding: 40px 20px;
    color: var(--wvdp-text-secondary);
    font-size: 16px;
}

/* Search Box */
.wvdp-search-wrapper {
    margin: 30px 0;
}

.wvdp-search-form {
    max-width: 900px;
    margin: 0 auto;
}

.wvdp-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 8px;
}

.wvdp-search-icon {
    position: absolute;
    left: 20px;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
}

.wvdp-search-input {
    flex: 1;
    padding: 12px 20px 12px 50px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    background: transparent !important;
    color: #1f2937 !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
}

.wvdp-search-input:focus {
    outline: none;
}

.wvdp-search-input::placeholder {
    color: #9ca3af;
}

.wvdp-search-category {
    padding: 12px 40px 12px 20px;
    border: none;
    /* border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb; */
    background: white;
    color: #1f2937;
    font-size: 15px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    width: auto;
    max-width: 220px;
    flex-shrink: 0;
    height: auto;
    margin-bottom: 0 !important;
}

.wvdp-search-category:focus {
    outline: none;
}

.wvdp-search-btn {
    padding: 5px 32px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-bottom: 0 !important;
    /* margin-left: 10px; */
}

.wvdp-search-btn:hover {
    background: #b91c1c;
}

/* Categories Grid */
.wvdp-categories-wrapper {
    margin: 30px 0;
}

.wvdp-categories-grid {
    display: grid;
    gap: 20px;
}

.wvdp-categories-columns-2 .wvdp-categories-grid {
    grid-template-columns: repeat(2, 1fr);
}

.wvdp-categories-columns-3 .wvdp-categories-grid {
    grid-template-columns: repeat(3, 1fr);
}

.wvdp-categories-columns-4 .wvdp-categories-grid {
    grid-template-columns: repeat(4, 1fr);
}

.wvdp-category-card {
    background: white;
    border: 1px solid var(--wvdp-border);
    border-radius: var(--wvdp-radius);
    transition: var(--wvdp-transition);
    overflow: hidden;
}

.wvdp-category-card:hover {
    box-shadow: var(--wvdp-shadow-hover);
    transform: translateY(-4px);
    border-color: var(--wvdp-primary);
}

.wvdp-category-link {
    display: block;
    padding: 24px;
    text-decoration: none;
    color: inherit;
}

/* Horizontal Header Layout */
.wvdp-category-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.wvdp-category-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--wvdp-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wvdp-category-icon svg {
    color: #5a6c7d;
}

.wvdp-category-info {
    flex: 1;
    min-width: 0;
}

.wvdp-category-title {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--wvdp-text-primary);
}

.wvdp-category-description {
    margin: 0;
    font-size: 13px;
    color: var(--wvdp-text-secondary);
    line-height: 1.5;
}

.wvdp-category-count {
    flex-shrink: 0;
    padding: 6px 14px;
    background: #fee;
    color: #e74c3c;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    align-self: flex-start;
}

.wvdp-category-count strong {
    font-weight: 700;
}

.wvdp-category-samples {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.wvdp-category-samples li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--wvdp-text-secondary);
    position: relative;
    padding-left: 16px;
}

.wvdp-category-samples li:before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--wvdp-text-secondary);
    font-weight: bold;
}

.wvdp-category-footer {
    padding-top: 16px;
    border-top: 1px solid var(--wvdp-border);
}

.wvdp-category-link-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--wvdp-primary);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    background: var(--wvdp-gray-50);
    border-radius: var(--wvdp-radius);
    transition: var(--wvdp-transition);
}

.wvdp-category-card:hover .wvdp-category-link-text {
    background: var(--wvdp-primary);
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {

    .wvdp-layout-grid.wvdp-columns-3 .wvdp-downloads-container,
    .wvdp-layout-grid.wvdp-columns-4 .wvdp-downloads-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wvdp-layout-grid .wvdp-downloads-container {
        grid-template-columns: 1fr;
    }

    .wvdp-download-card {
        padding: 16px;
    }

    .wvdp-download-icon {
        width: 45px;
        height: 45px;
    }

    .wvdp-download-icon svg {
        width: 22px;
        height: 22px;
    }

    .wvdp-download-title {
        font-size: 1rem;
    }

    .wvdp-download-description {
        font-size: 0.75rem;
    }

    .wvdp-download-meta {
        font-size: 0.75rem;
    }

    /* Categories responsive */
    .wvdp-categories-grid {
        grid-template-columns: 1fr !important;
    }

    /* Search responsive */
    .wvdp-search-input {
        font-size: 14px;
        padding: 14px 18px 14px 46px;
    }
}

@media (max-width: 480px) {
    .wvdp-downloads-wrapper {
        margin: 20px 0;
    }

    .wvdp-download-card {
        padding: 14px;
    }

    .wvdp-download-title {
        font-size: 0.95rem;
    }

    .wvdp-category-badge {
        font-size: 0.7rem;
        padding: 5px 12px;
    }
}