/**
 * Ryder Medical V4 - Resource Downloads Frontend Stylesheet
 * File: app/theme/ryder-v4/assets/css/resource-downloads.css
 */

.ryder-resources-section {
    padding: 72px 0 84px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.ryder-resources-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.ryder-resources-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 48px;
}

.ryder-resources-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1368d4;
    background-color: rgba(19, 104, 212, 0.08);
    border-radius: 9999px;
    margin-bottom: 12px;
}

.ryder-resources-title {
    font-size: 30px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin: 0 0 12px;
}

.ryder-resources-desc {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* 网格布局 */
.ryder-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* 卡片主体 */
.ryder-resource-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ryder-resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.12);
    border-color: #cbd5e1;
}

/* 卡片封面区 */
.ryder-resource-card-media {
    position: relative;
    width: 100%;
    height: 160px;
    background-color: #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ryder-resource-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ryder-resource-card:hover .ryder-resource-poster {
    transform: scale(1.04);
}

.ryder-resource-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #64748b;
}

.ryder-resource-placeholder.is-video {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #7c3aed;
}

.ryder-resource-placeholder.is-document {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0284c7;
}

.ryder-resource-placeholder.is-package {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #ea580c;
}

.ryder-resource-placeholder .ryder-icon {
    width: 44px;
    height: 44px;
}

/* 标签徽章 */
.ryder-resource-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.ryder-resource-tag.is-lead_gated {
    background-color: rgba(19, 104, 212, 0.9);
    color: #ffffff;
}

.ryder-resource-tag.is-public {
    background-color: rgba(34, 197, 94, 0.9);
    color: #ffffff;
}

/* 卡片内容 */
.ryder-resource-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ryder-resource-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.ryder-resource-version {
    background-color: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.ryder-resource-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ryder-resource-card-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ryder-resource-card-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

/* 按钮规范 */
.ryder-btn-download,
.ryder-btn-unlock,
.ryder-btn-play,
.ryder-btn-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.ryder-btn-download,
.ryder-btn-unlock,
.ryder-btn-play {
    background-color: #1368d4;
    color: #ffffff !important;
    flex-grow: 1;
}

.ryder-btn-download:hover,
.ryder-btn-unlock:hover,
.ryder-btn-play:hover {
    background-color: #0a4f9d;
    color: #ffffff !important;
}

.ryder-btn-preview {
    background-color: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
}

.ryder-btn-preview:hover {
    background-color: #e2e8f0;
    color: #0f172a !important;
}

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

/* -------------------------------------------------------------
 * 弹窗组件样式 (Modal Dialogs)
 * ----------------------------------------------------------- */
.ryder-asset-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ryder-asset-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.ryder-asset-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.ryder-asset-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    padding: 32px 28px 28px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    z-index: 10;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ryder-asset-modal.is-active .ryder-asset-modal-dialog {
    transform: translateY(0) scale(1);
}

.ryder-asset-modal-large .ryder-asset-modal-dialog {
    max-width: 900px;
    width: 95%;
    height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
}

.ryder-preview-frame-wrap {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.ryder-preview-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.ryder-asset-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.ryder-asset-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ryder-modal-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #1368d4;
    background: rgba(19, 104, 212, 0.1);
    border-radius: 4px;
    margin-bottom: 8px;
}

.ryder-asset-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.ryder-modal-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.5;
}

.ryder-modal-target-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ryder-modal-target-info .target-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.ryder-modal-target-info .target-meta {
    font-size: 12px;
    color: #94a3b8;
}

/* 留资表单字段 */
.ryder-form-group {
    margin-bottom: 14px;
}

.ryder-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 4px;
}

.ryder-form-group label .required {
    color: #ef4444;
}

.ryder-form-group label .optional {
    font-weight: 400;
    color: #94a3b8;
}

.ryder-form-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ryder-form-group input:focus {
    border-color: #1368d4;
    box-shadow: 0 0 0 3px rgba(19, 104, 212, 0.15);
}

.ryder-modal-submit-btn {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background-color: #1368d4;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
}

.ryder-modal-submit-btn:hover {
    background-color: #0a4f9d;
}

.ryder-form-status {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

.ryder-form-status.is-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ryder-unlock-success-box {
    text-align: center;
    padding: 16px 0;
}

.ryder-unlock-success-box .success-icon {
    width: 48px;
    height: 48px;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 12px;
}

.ryder-unlock-success-box h4 {
    font-size: 18px;
    color: #0f172a;
    margin: 0 0 8px;
}

.ryder-unlock-success-box p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 18px;
}

.ryder-direct-download-btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: #1368d4;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.ryder-direct-download-btn:hover {
    background-color: #0a4f9d;
}

.ryder-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
