/**
 * Lincolnwood Core - Frontend Styles
 * Modern, responsive styles for grid layouts and frontend components
 */

/* Grid System */
.lw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lw-grid-1-col {
    grid-template-columns: 1fr;
}

.lw-grid-2-col {
    grid-template-columns: repeat(2, 1fr);
}

.lw-grid-3-col {
    grid-template-columns: repeat(3, 1fr);
}

.lw-grid-4-col {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    .lw-grid-4-col {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .lw-grid-3-col,
    .lw-grid-4-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .lw-grid,
    .lw-grid-2-col,
    .lw-grid-3-col,
    .lw-grid-4-col {
        grid-template-columns: 1fr;
    }
}

/* Card Styling */
.lw-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.lw-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.lw-card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.lw-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.lw-card:hover .lw-card-image img {
    transform: scale(1.05);
}

.lw-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.lw-card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.lw-card-title {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    line-height: 1.3;
    color: #333;
}

.lw-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.lw-card-title a:hover {
    color: #0073aa;
}

.lw-card-excerpt {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.6;
    flex-grow: 1;
}

.lw-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.lw-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #777;
    font-size: 0.9rem;
}

.lw-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #999;
}

.lw-card-footer {
    margin-top: auto;
}

/* Button Styling */
.lw-primary-button,
.lw-action-button {
    display: inline-block;
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.lw-primary-button:hover,
.lw-action-button:hover {
    background: #005a87;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.lw-primary-button:active,
.lw-action-button:active {
    transform: translateY(0);
}

/* Single Program Template */
.lw-single-program {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.lw-program-hero {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
}

.lw-program-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lw-program-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    display: flex;
    align-items: flex-end;
    padding: 40px;
}

.lw-program-hero-title {
    color: white;
    font-size: 3rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.lw-program-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

@media (max-width: 992px) {
    .lw-program-content {
        grid-template-columns: 1fr;
    }
}

.lw-program-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.lw-program-description h2,
.lw-program-description h3 {
    color: #222;
    margin-top: 30px;
    margin-bottom: 15px;
}

.lw-program-description p {
    margin-bottom: 20px;
}

.lw-program-sidebar {
    position: sticky;
    top: 40px;
}

.lw-info-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.lw-info-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    color: #333;
}

.lw-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lw-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.lw-info-item:last-child {
    border-bottom: none;
}

.lw-info-label {
    font-weight: 600;
    color: #555;
}

.lw-info-value {
    color: #333;
    text-align: right;
}

/* PlayMetrics Action Button */
.lw-playmetrics-button {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: 20px;
}

.lw-playmetrics-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Utility Classes */
.lw-text-center {
    text-align: center;
}

.lw-mt-20 {
    margin-top: 20px;
}

.lw-mb-20 {
    margin-bottom: 20px;
}

.lw-hidden {
    display: none !important;
}

/* Loading States */
.lw-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: lw-spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes lw-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty States */
.lw-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.lw-empty-state .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    color: #ccc;
}

.lw-empty-state h3 {
    margin: 0 0 10px 0;
    color: #444;
}

.lw-empty-state p {
    margin: 0;
    max-width: 400px;
    margin: 0 auto;
}

/* Print Styles */
@media print {
    .lw-action-button,
    .lw-playmetrics-button {
        display: none;
    }
    
    .lw-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .lw-program-hero {
        height: 200px;
    }
}

/* ============================================
   REPEATER FIELD STYLES
   ============================================ */

.lw-repeater-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.lw-repeater-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
}

.lw-repeater-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.lw-repeater-icon {
    font-size: 32px;
    color: #0073aa;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f9ff;
    border-radius: 8px;
}

.lw-repeater-icon i {
    font-size: inherit;
}

.lw-repeater-text {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    flex: 1;
    padding-top: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.lw-repeater-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.lw-repeater-list .lw-repeater-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lw-repeater-list .lw-repeater-item:last-child {
    border-bottom: none;
}

.lw-repeater-list .lw-repeater-item i {
    color: #0073aa;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.lw-repeater-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.lw-repeater-inline .lw-repeater-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 20px;
}

.lw-repeater-inline .lw-repeater-item i {
    color: #0073aa;
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lw-repeater-grid {
        gap: 15px;
    }
    
    .lw-repeater-card {
        padding: 15px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .lw-repeater-icon {
        font-size: 28px;
        width: 50px;
        height: 50px;
        margin-bottom: 0;
    }
    
    .lw-repeater-inline {
        gap: 10px;
    }
    
    .lw-repeater-inline .lw-repeater-item {
        padding: 6px 12px;
        font-size: 14px;
    }
}