/**
 * Dictionary Landing Page Widgets Styling
 * Million-Dollar Merriam-Webster Inspired Design
 *
 * @package Gagana_Samoa
 */

/* Main Widgets Section */
.dictionary-widgets {
    padding: 60px 0;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: -1px;
    position: relative;
    z-index: 1;
    transform: translateZ(0);
}

.widgets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Individual Widget Container */
.dictionary-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Widget External Titles - Merriam-Webster Style */
.widget-external-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #2c2c2c;
    text-align: center;
    font-family: 'Aleo', serif;
    letter-spacing: -0.02em;
}

.widget-external-date {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 20px 0;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Professional Card Design */
.widget-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    height: 400px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    overflow: hidden;
}

.widget-card:hover {
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.widget-content {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ===========================================
   Widget 1: Newest Words Added
   =========================================== */

.newest-words-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.newest-word-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.15s ease;
    min-height: 32px;
}

.newest-word-item:last-child {
    border-bottom: none;
}

.newest-word-item:hover {
    background: rgba(246, 180, 2, 0.04);
    margin: 0 -8px;
    padding: 0 8px;
    border-radius: 4px;
}

.word-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.word-title {
    font-weight: 600;
    color: #2c2c2c;
    font-size: 1rem;
    transition: color 0.15s ease;
}

.newest-word-item:hover .word-title {
    color: #d4a017;
}

.pos-badge {
    background: #f0f0f0;
    color: #666;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.no-words {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.no-words p {
    color: #888;
    font-style: italic;
}

/* ===========================================
   Widget 2: Old Samoan Word (Coming Soon)
   =========================================== */

.coming-soon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    gap: 16px;
}

.coming-soon-icon {
    color: #8b4513;
    opacity: 0.7;
}

.coming-soon-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #8b4513;
    margin: 0;
    line-height: 1.4;
    max-width: 200px;
}

.coming-soon-content p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
    font-weight: 500;
}

/* ===========================================
   Widget 3: Top Word Searches
   =========================================== */

.top-searches-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
    min-height: 28px;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(0, 123, 152, 0.04);
    margin: 0 -8px;
    padding: 0 8px;
    border-radius: 4px;
}

.search-rank {
    font-weight: 700;
    color: #007b98;
    font-size: 1rem;
    min-width: 24px;
    margin-right: 16px;
    text-align: center;
}

.search-term {
    font-weight: 600;
    color: #2c2c2c;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.15s ease;
    flex: 1;
}

.search-item:hover .search-term {
    color: #007b98;
}

.no-searches {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.no-searches p {
    color: #888;
    font-style: italic;
}

/* Widget Footer & Refresh Timer */
.widget-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.refresh-info {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    margin: 0;
    font-weight: 500;
}

.refresh-label {
    margin-right: 4px;
}

.refresh-time {
    color: #007b98;
    font-weight: 600;
}

/* ===========================================
   Responsive Design
   =========================================== */

@media (max-width: 1024px) {
    .widgets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .dictionary-widget:last-child {
        grid-column: 1 / -1;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .dictionary-widgets {
        padding: 60px 0;
    }
    
    .widgets-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 15px;
    }
    
    .widget-card {
        height: 350px;
    }
    
    .widget-content {
        padding: 20px;
    }
    
    .widget-external-title {
        font-size: 1.2rem;
    }
    
    .dictionary-widget:last-child {
        grid-column: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .widgets-grid {
        padding: 0 10px;
    }
    
    .widget-content {
        padding: 16px;
    }
    
    .newest-word-item {
        padding: 0;
        min-height: 28px;
    }
    
    .search-item {
        padding: 0;
        min-height: 24px;
    }
    
    .word-title,
    .search-term {
        font-size: 0.9rem;
    }
}

/* ===========================================
   Accessibility & Print Styles
   =========================================== */

@media (prefers-reduced-motion: reduce) {
    .widget-card,
    .newest-word-item,
    .search-item,
    .word-title,
    .search-term {
        transition: none;
    }
    
    .widget-card:hover {
        transform: none;
    }
}

@media print {
    .dictionary-widgets {
        background: white;
        box-shadow: none;
    }
    
    .widget-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}