/*==============================================================================
  Moodle Modules — Landing Widget Styles
  ============================================================================*/

.oew-moodle-modules {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.oew-moodle-modules-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    min-width: 0;
}

@media (max-width: 1024px) {
    .oew-moodle-modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.oew-moodle-modules-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--oew-background, #ffffff);
    border: 1px solid var(--oew-border, #e0e0e0);
    border-left: 4px solid var(--oew-primary, #003556);
    border-radius: 8px;
    padding: 28px 20px;
    box-shadow: 0 2px 8px var(--oew-shadow, rgba(0, 0, 0, 0.08));
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Remove underlines from card title on all states */
.oew-moodle-modules-card .oew-moodle-modules-title,
.oew-moodle-modules-card:link .oew-moodle-modules-title,
.oew-moodle-modules-card:visited .oew-moodle-modules-title,
.oew-moodle-modules-card:hover .oew-moodle-modules-title,
.oew-moodle-modules-card:focus .oew-moodle-modules-title,
.oew-moodle-modules-card:active .oew-moodle-modules-title {
    text-decoration: none;
}

/* Also remove any underline from the card link itself */
.oew-moodle-modules-card,
.oew-moodle-modules-card:link,
.oew-moodle-modules-card:visited,
.oew-moodle-modules-card:hover,
.oew-moodle-modules-card:focus,
.oew-moodle-modules-card:active {
    text-decoration: none !important;
}

.oew-moodle-modules-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--oew-shadow-hover, rgba(0, 0, 0, 0.12));
}

.oew-moodle-modules-card:hover .oew-moodle-modules-title,
.oew-moodle-modules-card:focus .oew-moodle-modules-title {
    text-decoration: none;
}

.oew-moodle-modules-card:visited,
.oew-moodle-modules-card:active,
.oew-moodle-modules-card:focus {
    color: inherit;
    outline: none;
}

.oew-moodle-modules-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--oew-primary, #003556);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 14px;
    flex-shrink: 0;
    line-height: 1;
}

.oew-moodle-modules-content {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.oew-moodle-modules-title {
    font-family: verdana;
    font-size: 16px;
    font-weight: 600;
    color: var(--oew-primary, #003556);
    margin: 0 0 10px;
    max-width: 100%;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.oew-moodle-modules-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    background: var(--oew-secondary, #009790);
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

.oew-moodle-modules-icon {
    font-size: 28px;
    color: var(--oew-secondary, #009790);
    margin-top: 14px;
}

.oew-moodle-modules-skeleton {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.oew-moodle-modules-skeleton .oew-skeleton-card {
    height: 180px;
    background: #f0f0f0;
    border-radius: 8px;
    animation: oew-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes oew-skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.8; }
}

.oew-moodle-modules-error,
.oew-moodle-modules-empty {
    padding: 20px 24px;
    background: var(--oew-background, #FFFFFF);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.oew-moodle-modules-error { border-left: 4px solid #dc3232; }
.oew-moodle-modules-empty { border-left: 4px solid #ffb900; }

.oew-moodle-modules-error p,
.oew-moodle-modules-empty p { margin: 0; font-size: 14px; line-height: 1.5; }
.oew-moodle-modules-error p { color: var(--oew-text, #333333); }
.oew-moodle-modules-empty p { color: var(--oew-text-muted, #666666); }
