/**
 * Press Release Widget - Reimagined Design
 * A fresh, modern approach to SaaS widget design
 */

/* Reset and Base Styles */
.prw-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(145deg, #FFFFFF 0%, #FAFBFC 100%);
    border-radius: 16px;
    box-shadow: 
        0 4px 20px rgba(16, 24, 40, 0.08),
        0 1px 3px rgba(16, 24, 40, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(229, 231, 235, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Header Section */
.prw-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 32px 32px 28px;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.prw-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    backdrop-filter: blur(10px);
}

.prw-header-content {
    position: relative;
    z-index: 2;
}

.prw-header-title {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 8px 0;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.prw-header-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Live Indicator */
.prw-live-indicator {
    position: absolute;
    top: 32px;
    right: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prw-live-dot {
    width: 8px;
    height: 8px;
    background: #22C55E;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.prw-live-text {
    font-size: 12px;
    font-weight: 600;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Column Headers */
.prw-columns {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    padding: 20px 32px;
    background: linear-gradient(to right, #F8FAFC, #F1F5F9);
    border-bottom: 1px solid rgba(229, 231, 235, 0.6);
    position: relative;
}

.prw-columns::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.prw-column-header {
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Content Area */
.prw-content {
    padding: 0;
}

/* Individual Row */
.prw-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    padding: 20px 32px;
    border-bottom: 1px solid rgba(243, 244, 246, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(248, 250, 252, 0.8));
}

.prw-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.prw-row:last-child {
    border-bottom: none;
}

.prw-row:hover {
    background: linear-gradient(to right, #FFFFFF, #F8FAFC);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.08),
        0 3px 10px rgba(0, 0, 0, 0.04);
}

.prw-row:hover::before {
    width: 4px;
}

/* Website Column */
.prw-website {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.prw-website-info {
    min-width: 0;
    flex: 1;
}

.prw-website-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.prw-website-link {
    color: #2762F8;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 8px 12px;
    margin: -8px -12px;
    border-radius: 6px;
    display: inline-block;
    outline: none;
    position: relative;
}

.prw-website-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s ease;
}

.prw-website-link:hover {
    color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.prw-website-link:hover::before {
    left: 100%;
}

/* DR Badge */
.prw-dr-container {
    display: flex;
    align-items: center;
}

.prw-dr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 36px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: white;
    padding: 0 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.prw-dr-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.8s ease;
}

.prw-row:hover .prw-dr-badge {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.prw-row:hover .prw-dr-badge::before {
    left: 100%;
}

/* DR Badge Colors */
.prw-dr-high {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.3),
        0 2px 4px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.prw-dr-medium {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    box-shadow: 
        0 4px 12px rgba(245, 158, 11, 0.3),
        0 2px 4px rgba(245, 158, 11, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.prw-dr-low {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    box-shadow: 
        0 4px 12px rgba(239, 68, 68, 0.3),
        0 2px 4px rgba(239, 68, 68, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Empty State */
.prw-empty {
    padding: 48px 24px;
    text-align: center;
    color: #6B7280;
}

.prw-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.prw-empty-title {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 8px 0;
}

.prw-empty-text {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

/* Loading State */
.prw-loading {
    padding: 48px 24px;
    text-align: center;
}

.prw-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #F3F4F6;
    border-top: 3px solid #2762F8;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.prw-loading-text {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

/* Row Animation */
.prw-row-enter {
    opacity: 0;
    transform: translateY(10px);
    animation: rowEnter 0.3s ease forwards;
}

@keyframes rowEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Live Update Flash */
.prw-row-flash {
    animation: flash 1.5s ease-out;
}

@keyframes flash {
    0% { background-color: rgba(34, 197, 94, 0.1); }
    100% { background-color: transparent; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .prw-container {
        margin: 10px;
        border-radius: 12px;
        max-width: calc(100vw - 20px);
    }
    
    .prw-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .prw-header-title {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .prw-header-subtitle {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .prw-columns {
        padding: 0 20px;
    }
    
    .prw-column-header:first-child {
        flex: 2;
    }
    
    .prw-column-header:last-child {
        flex: 1;
        text-align: center;
    }
    
    .prw-row {
        padding: 14px 20px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .prw-website {
        flex: none;
        width: 100%;
    }
    
    .prw-dr-container {
        flex: none;
        justify-content: flex-start;
        width: 100%;
    }
    
    .prw-website-name {
        font-size: 15px;
    }
    
    .prw-dr-badge {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .prw-website-link {
        padding: 6px 8px;
        margin: -6px -8px;
    }
}

@media (max-width: 480px) {
    .prw-container {
        margin: 5px;
        border-radius: 8px;
    }
    
    .prw-header {
        padding: 16px;
    }
    
    .prw-header-title {
        font-size: 18px;
    }
    
    .prw-header-subtitle {
        font-size: 13px;
    }
    
    .prw-columns {
        padding: 0 16px;
    }
    
    .prw-row {
        padding: 12px 16px;
    }
    
    .prw-website-name {
        font-size: 14px;
    }
    
    .prw-dr-badge {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* Accessibility improvements */
.prw-container:focus-within {
    outline: 2px solid #2762F8;
    outline-offset: 2px;
}

.prw-website-link:focus {
    outline: 2px solid #2762F8;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(39, 98, 248, 0.2);
}

.prw-website-link:focus-visible {
    outline: 2px solid #2762F8;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .prw-container {
        border: 2px solid #000000;
        background: #ffffff;
    }
    
    .prw-header {
        background: #000000;
        border-bottom: 2px solid #000000;
    }
    
    .prw-header-title,
    .prw-header-subtitle {
        color: #ffffff !important;
    }
    
    .prw-website-link {
        color: #0066cc;
        text-decoration: underline;
    }
    
    .prw-dr-badge {
        border: 2px solid #000000;
        background: #ffffff;
        color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .prw-container,
    .prw-website-link,
    .prw-dr-badge,
    .prw-row,
    .prw-live-dot {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .prw-container {
        background: #1F2937;
        border-color: #374151;
    }
    
    .prw-header {
        background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
        border-bottom-color: #374151;
    }
    
    .prw-header-title {
        color: #F9FAFB;
    }
    
    .prw-header-subtitle {
        color: #9CA3AF;
    }
    
    .prw-columns {
        background: #111827;
        border-bottom-color: #374151;
    }
    
    .prw-column-header {
        color: #9CA3AF;
    }
    
    .prw-row {
        border-bottom-color: #374151;
    }
    
    .prw-row:hover {
        background: #111827;
    }
    
    .prw-website-name {
        color: #F9FAFB;
    }
    
    .prw-website-url {
        color: #9CA3AF;
    }
    
    .prw-website-link:hover {
        color: #60A5FA;
    }
}
