/**
 * Modules Grid Layout Styles
 * @package Mokymu_Temos
 * @since 1.0.2
 */

/* ========================================
   MODULES GRID LAYOUT
   ======================================== */

.mt-modules-container {
    max-width: 100%;
    margin: 0;
    padding: 20px;
}

.mt-modules-header {
    text-align: left;
    margin-bottom: 3rem;
}

.mt-modules-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--mt-secondary-color);
    margin-bottom: 1rem;
}

.mt-modules-intro {
    font-size: 1.125rem;
    color: var(--mt-gray-medium);
    max-width: none;
    margin: 0 auto;
    line-height: 1.6;
}

.mt-purchase-info {
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dd 100%);
    border-left: 4px solid #df5b16;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(223, 91, 22, 0.1);
}

.mt-purchase-info p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

.mt-purchase-info strong {
    color: #001e49;
    font-weight: 600;
}

.mt-modules-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .mt-modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .mt-modules-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.mt-module-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mt-module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #d0d0d0;
}

.mt-module-thumbnail {
    position: relative;
    overflow: hidden;
    background: var(--mt-gray-light);
}

.mt-module-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--mt-transition);
}

.mt-module-card:hover .mt-module-thumbnail img {
    transform: scale(1.05);
}

.mt-module-badge-completed {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--mt-success-color);
    color: var(--mt-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mt-module-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mt-module-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
    color: #1a1a1a;
}

.mt-module-intro {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.mt-module-meta {
    display: flex;
    gap: 1rem;
    margin: 0;
    font-size: 0.875rem;
    color: #666;
    flex-wrap: wrap;
}

.mt-module-steps,
.mt-module-progress,
.mt-module-type {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #f9fafb;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.mt-module-button {
    display: inline-block;
    background: linear-gradient(135deg, #df5b16 0%, #c44d12 100%);
    color: #ffffff !important;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: auto;
    box-shadow: 0 2px 8px rgba(223, 91, 22, 0.3);
    border: none;
    position: relative;
    overflow: hidden;
}

.mt-module-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.mt-module-button:hover::before {
    left: 100%;
}

.mt-module-button:hover {
    background: linear-gradient(135deg, #c44d12 0%, #a93f0f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(223, 91, 22, 0.4);
    color: #ffffff;
}

.mt-module-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(223, 91, 22, 0.3);
}

.mt-module-completed .mt-module-button {
    background: linear-gradient(135deg, #001e49 0%, #003366 100%);
    box-shadow: 0 2px 8px rgba(0, 30, 73, 0.3);
}
 
.mt-module-completed .mt-module-button:hover {
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    box-shadow: 0 4px 12px rgba(0, 30, 73, 0.4);
    transform: translateY(-2px);
}

.mt-button-locked {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: 0.7;
}

.mt-button-locked:hover {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    transform: none !important;
    box-shadow: none !important;
}

.mt-button-purchase {
    background: linear-gradient(135deg, #df5b16 0%, #c44d12 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(223, 91, 22, 0.3);
}

.mt-button-purchase:hover {
    background: linear-gradient(135deg, #c44d12 0%, #a93f0f 100%);
    box-shadow: 0 4px 12px rgba(223, 91, 22, 0.4);
}

.mt-button-purchase.loading {
    opacity: 0.7;
    cursor: wait;
}

.mt-button-purchase.added {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

@media (max-width: 767px) {
    .mt-modules-title {
        font-size: 2rem;
    }
    
    .mt-modules-intro {
        font-size: 1rem;
    }
    
    .mt-modules-grid {
        gap: 1.5rem;
    }
    
    .mt-module-thumbnail img {
        height: 180px;
    }
}
/* ========================================
   COMPLETION STATUS ICON
   ======================================== */

.mt-module-status-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    z-index: 10;
    transition: all 0.3s ease;
}

.mt-module-status-icon.completed {
    color: #f59e0b; /* Yellow/amber */
}

.mt-module-status-icon.incomplete {
    color: #d1d5db; /* Gray */
}

.mt-module-status-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* ========================================
   VIEW TOGGLE
   ======================================== */

.mt-view-toggle {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.mt-filter-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mt-filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-right: 0.25rem;
}

.mt-filter-btn {
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mt-filter-btn:hover {
    background: #f9fafb;
    color: #001e49;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.mt-filter-btn.active {
    background: linear-gradient(135deg, #001e49 0%, #003366 100%);
    color: #ffffff;
    border-color: #001e49;
    box-shadow: 0 2px 8px rgba(0, 30, 73, 0.25);
}

.mt-view-buttons {
    display: flex;
    gap: 0.5rem;
}

.mt-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mt-toggle-btn:hover {
    background: #f9fafb;
    color: #001e49;
    border-color: #d1d5db;
    transform: scale(1.05);
}

.mt-toggle-btn.active {
    background: linear-gradient(135deg, #001e49 0%, #003366 100%);
    color: #ffffff;
    border-color: #001e49;
    box-shadow: 0 2px 6px rgba(0, 30, 73, 0.25);
}

.mt-toggle-btn svg {
    pointer-events: none;
}

/* ========================================
   LIST VIEW LAYOUT
   ======================================== */

.mt-modules-grid[data-view="list"] {
    grid-template-columns: 1fr;
}

.mt-modules-grid[data-view="list"] .mt-module-card {
    flex-direction: row;
    align-items: center;
}

.mt-modules-grid[data-view="list"] .mt-module-thumbnail {
    flex: 0 0 200px;
    height: 150px;
}

.mt-modules-grid[data-view="list"] .mt-module-thumbnail img {
    height: 100%;
}

.mt-modules-grid[data-view="list"] .mt-module-content {
    flex: 1;
    padding: 1.5rem;
}

.mt-modules-grid[data-view="list"] .mt-module-status-icon {
    right: 1.5rem;
    top: 1.5rem;
    transform: none;
}

@media (max-width: 767px) {
    .mt-view-toggle {
        flex-direction: column;
        gap: 1rem;
    }
    
    .mt-filter-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .mt-view-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .mt-modules-grid[data-view="list"] .mt-module-card {
        flex-direction: column;
    }
    
    .mt-modules-grid[data-view="list"] .mt-module-thumbnail {
        flex: 0 0 auto;
        width: 100%;
        height: 180px;
    }
}