/* Educational Materials Manager - Professional Frontend Styles */

/* General Styles & Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.emm-materials-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Materials List Header */
.emm-materials-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.emm-materials-header h3 {
    margin: 0 0 10px 0;
    color: #1a202c;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.emm-materials-header p {
    margin: 0;
    color: #718096;
    font-size: 1.15rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Layout Grid */
.emm-materials-list {
    display: grid;
    gap: 30px;
    margin: 0;
}

.emm-layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.emm-layout-list {
    grid-template-columns: 1fr;
}

/* Material Items - Enhanced Card Design */
.emm-material-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.emm-material-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #6b9f6e;
}

.emm-material-thumbnail {
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.emm-material-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.emm-material-item:hover .emm-material-thumbnail img {
    transform: scale(1.05);
}

.emm-material-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.emm-material-title {
    margin: 0 0 12px 0;
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.4;
}

.emm-material-title a {
    color: #1a202c;
    text-decoration: none;
    transition: color 0.2s ease;
}

.emm-material-title a:hover {
    color: #6b9f6e;
}

.emm-material-excerpt {
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 0.95rem;
    flex-grow: 1;
}

/* Meta Tags */
.emm-material-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85em;
    margin-bottom: 20px;
}

.emm-material-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f7fafc;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    font-weight: 500;
}

.emm-meta-categories {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

.emm-meta-difficulty {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
}

/* Action Buttons */
.emm-material-actions {
    margin-top: auto; /* Pushes to the bottom */
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end; /* Align button to the right */
}

.emm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* width: 100%; */ /* REMOVED to make button smaller */
    padding: 10px 20px; /* Adjusted padding */
    background: #6b9f6e;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emm-btn:hover {
    background: #5a8a5e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 159, 110, 0.2);
    color: white;
}

/* No Materials Found Message */
.emm-no-materials {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 16px;
}

.emm-no-materials h4 {
    font-size: 1.5rem;
    color: #1a202c;
    margin: 0 0 10px 0;
}

.emm-no-materials p {
    color: #718096;
    font-size: 1.1rem;
    margin: 0;
}

/* List Layout Specifics */
.emm-layout-list .emm-material-item {
    flex-direction: row;
}

.emm-layout-list .emm-material-thumbnail {
    width: 250px;
    height: auto;
    padding-top: 0;
    flex-shrink: 0;
}

.emm-layout-list .emm-material-thumbnail img {
    position: static;
    height: 100%;
}

@media (max-width: 768px) {
    .emm-layout-list .emm-material-item {
        flex-direction: column;
    }
    .emm-layout-list .emm-material-thumbnail {
        width: 100%;
        padding-top: 56.25%;
        position: relative;
    }
    .emm-layout-list .emm-material-thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
    }
}
