/**
 * Medications Letter Pages Styling
 * Modern, clean design with SEO-friendly structure
 * 
 * @package Railway_Info
 * @since 1.0.0
 */

/* Letter Navigation Grid */
.medications-letter-nav {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.letter-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.letter-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 80px;
    position: relative;
}

.letter-nav-item:not(.disabled) {
    cursor: pointer;
}

.letter-nav-item:not(.disabled):hover {
    transform: translateY(-3px);
    border-color: #2271b1;
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.15);
}

.letter-nav-item.active {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border-color: #2271b1;
    color: #ffffff;
}

.letter-nav-item.disabled {
    background: #f9fafb;
    border-color: #e5e7eb;
    opacity: 0.5;
    cursor: not-allowed;
}

.letter-nav-item .letter {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
    color: inherit;
}

.letter-nav-item.active .letter {
    color: #ffffff;
}

.letter-nav-item .count {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 3px 10px;
    border-radius: 12px;
}

.letter-nav-item.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.letter-nav-item.disabled .count {
    background: transparent;
}

/* Statistics Box */
.medications-stats-box {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f9ff 100%);
    border-left: 4px solid #2271b1;
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
}

.medications-stats-box .highlight {
    color: #2271b1;
    font-weight: 700;
    font-size: 18px;
}

/* Medications Container */
.medications-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.medications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #e1e8ed;
}

.medications-header h2 {
    margin: 0;
    font-size: 32px;
    color: #1a202c;
    font-weight: 700;
}

.medications-count {
    background: #2271b1;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Search Box */
.medications-search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    max-width: 600px;
}

.medications-search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.medications-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.medications-search-btn {
    padding: 14px 30px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.medications-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

/* Medications List */
.medications-list {
    display: grid;
    gap: 20px;
}

.medication-item {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
}

.medication-item:hover {
    border-color: #2271b1;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateX(5px);
}

.medication-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.medication-name {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
}

.prescription-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
}

.medication-details {
    display: grid;
    gap: 12px;
}

.medication-detail {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    font-size: 15px;
}

.medication-detail strong {
    color: #6b7280;
    font-weight: 600;
}

.medication-detail span {
    color: #1a202c;
}

.medication-prices {
    display: flex;
    gap: 20px;
    margin: 12px 0;
    padding: 12px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.price-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.price-value {
    font-size: 20px;
    font-weight: 700;
    color: #2271b1;
}

.medication-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    color: #4b5563;
    line-height: 1.6;
}

.medication-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.medication-source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.medication-source-link:hover {
    color: #135e96;
    gap: 10px;
}

/* Enhanced Pagination */
.medications-pagination {
    margin: 50px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.medications-pagination .page-numbers {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}

.medications-pagination a,
.medications-pagination span {
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.medications-pagination a:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.medications-pagination .current {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #ffffff;
    border-color: #2271b1;
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.25);
    font-weight: 600;
}

.medications-pagination .dots {
    padding: 10px 6px;
    color: #6b7280;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 14px;
}

.medications-pagination .prev,
.medications-pagination .next,
.medications-pagination .first,
.medications-pagination .last {
    font-weight: 600;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: 14px;
}

.medications-pagination .prev:hover,
.medications-pagination .next:hover,
.medications-pagination .first:hover,
.medications-pagination .last:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
}

.medications-pagination .first::before {
    content: "« ";
    font-weight: 700;
}

.medications-pagination .last::after {
    content: " »";
    font-weight: 700;
}

/* Hide some page numbers for better UX */
.medications-pagination .page-numbers li:nth-child(n+8):nth-child(-n+12) {
    display: none;
}

/* Show ellipsis for hidden pages */
.medications-pagination .page-numbers li:nth-child(8)::after {
    content: "...";
    display: inline-block;
    padding: 10px 6px;
    color: #6b7280;
    font-weight: 600;
}

/* Mobile responsive pagination */
@media (max-width: 640px) {
    .medications-pagination .page-numbers {
        gap: 4px;
    }

    .medications-pagination a,
    .medications-pagination span {
        padding: 8px 10px;
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .medications-pagination .prev,
    .medications-pagination .next,
    .medications-pagination .first,
    .medications-pagination .last {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Informational Section */
.medications-container h3 {
    color: #1a202c;
    font-size: 24px;
    font-weight: 700;
    margin: 40px 0 20px;
}

.medications-container ul {
    list-style: none;
    padding: 0;
}

.medications-container ul li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
    color: #4b5563;
}

.medications-container ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #2271b1;
    font-weight: 700;
    font-size: 18px;
}

/* No Results */
.no-medications {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 18px;
    background: #f9fafb;
    border-radius: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .letter-nav-grid {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 8px;
    }
    
    .letter-nav-item {
        padding: 12px 4px;
        min-height: 70px;
    }
    
    .letter-nav-item .letter {
        font-size: 22px;
    }
    
    .letter-nav-item .count {
        font-size: 11px;
        padding: 2px 8px;
    }
    
    .medications-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .medications-header h2 {
        font-size: 24px;
    }
    
    .medications-search-box {
        flex-direction: column;
        max-width: 100%;
    }
    
    .medication-detail {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .medication-prices {
        flex-direction: column;
        gap: 12px;
    }
    
    .medications-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .letter-nav-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .medications-letter-nav {
        padding: 20px 15px;
    }
    
    .medication-item {
        padding: 16px;
    }
    
    .medication-name {
        font-size: 18px;
    }
}

/* Print Styles */
@media print {
    .medications-search-box,
    .medications-letter-nav,
    .medication-footer {
        display: none;
    }
    
    .medication-item {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

