/* Multi-Platform Content Optimization, Scheduling, and Analytics Styles */
/* Enhanced Reddit Viral Dashboard Features */

/* Platform Optimization Styles */
.platform-optimizer {
    max-width: 1200px;
    margin: 0 auto;
}

.optimizer-input {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.platform-selection {
    margin-bottom: 30px;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.platform-card {
    display: block;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.platform-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.platform-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.platform-card input[type="checkbox"]:checked + .platform-info {
    color: #007bff;
}

.platform-card input[type="checkbox"]:checked {
    & ~ .platform-info::before {
        content: '✓';
        position: absolute;
        top: -5px;
        right: -5px;
        background: #007bff;
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: bold;
    }
}

.platform-info {
    text-align: center;
    position: relative;
}

.platform-info i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.platform-info span {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.platform-info small {
    color: #6c757d;
    font-size: 12px;
}

.optimization-options {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.optimization-results {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.platform-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.platform-result-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.platform-header {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.platform-header i {
    font-size: 20px;
    margin-right: 10px;
}

.platform-header h4 {
    margin: 0;
    flex: 1;
}

.platform-stats {
    display: flex;
    gap: 10px;
}

.platform-stats .stat {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.platform-content {
    padding: 15px;
}

.content-section {
    margin-bottom: 15px;
}

.content-section label {
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.content-text {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 14px;
    line-height: 1.4;
}

.hashtags {
    color: #007bff;
    font-weight: 500;
    font-size: 14px;
}

.platform-actions {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

/* Content Scheduler Styles */
.scheduler-container {
    max-width: 1200px;
    margin: 0 auto;
}

.quick-schedule {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.schedule-form {
    max-width: 600px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.schedule-options {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.custom-time-section {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.optimal-times {
    margin-bottom: 30px;
}

.optimal-times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.optimal-time-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.optimal-time-card .platform-icon {
    font-size: 24px;
    margin-bottom: 10px;
    color: #007bff;
}

.optimal-time-card h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.time-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-slot {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
}

.time-slot .time {
    font-weight: 600;
    display: block;
}

.time-slot .engagement {
    color: #28a745;
    font-size: 12px;
}

.scheduled-posts {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.scheduled-posts .section-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-stats {
    display: flex;
    gap: 10px;
}

.stat-badge {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.schedule-filters {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scheduled-posts-list {
    max-height: 400px;
    overflow-y: auto;
}

.scheduled-post-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.post-content h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.post-content p {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 14px;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
}

.post-meta .platform {
    color: #007bff;
    font-weight: 500;
}

.post-meta .schedule-time {
    color: #6c757d;
}

.status {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 10px;
}

.status-scheduled {
    background: #fff3cd;
    color: #856404;
}

.status-posted {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.post-actions {
    display: flex;
    gap: 8px;
}

/* Analytics Styles */
.analytics-dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

/* Analytics Info Section */
.analytics-info {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.info-item i {
    color: var(--primary-color);
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.info-item span {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

/* Analytics Loading and Error States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

.empty-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: #6c757d;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e9ecef;
}

.empty-state i, .error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.error-state i {
    color: #dc3545;
}

.empty-state p, .error-state p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.empty-state small, .error-state small {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 1rem;
}

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

.analytics-overview {
    margin-bottom: 30px;
}

/* Enhanced Platform Chart */
.platform-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.platform-bar {
    display: grid;
    grid-template-columns: 150px 1fr 100px;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.platform-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.platform-label i {
    font-size: 1.2rem;
    color: #007bff;
}

.platform-label small {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.2rem;
}

.bar-container {
    position: relative;
    height: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 12px;
    position: relative;
    transition: width 0.3s ease;
    min-width: 2px;
}

.bar-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.platform-stats {
    text-align: right;
    font-size: 0.9rem;
    color: #6c757d;
}

.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    background: #007bff;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-info h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #212529;
}

.stat-info p {
    margin: 5px 0;
    color: #6c757d;
    font-size: 14px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.stat-change.positive {
    background: #d4edda;
    color: #155724;
}

.stat-change.negative {
    background: #f8d7da;
    color: #721c24;
}

.platform-performance {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.performance-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-container {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-chart {
    width: 100%;
}

.platform-bar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.platform-label {
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.bar-container {
    flex: 1;
    background: #f8f9fa;
    border-radius: 4px;
    height: 30px;
    position: relative;
    overflow: hidden;
}

.bar {
    background: linear-gradient(90deg, #007bff, #0056b3);
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: 60px;
    transition: width 0.3s ease;
}

.bar-value {
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.top-content {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.top-content-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.top-content-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.content-rank {
    background: #007bff;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.content-info {
    flex: 1;
}

.content-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.content-info p {
    margin: 0 0 8px 0;
    color: #6c757d;
    font-size: 14px;
}

.content-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #6c757d;
}

.content-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.content-platform {
    font-size: 20px;
    color: #007bff;
}

.analytics-insights {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

/* Enhanced Top Content */
.top-content-item {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.top-content-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.content-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
}

.content-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #212529;
    line-height: 1.3;
}

.content-info p {
    margin: 0 0 0.75rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.content-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.content-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.content-stats i {
    font-size: 0.7rem;
}

.content-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.content-meta .subreddit {
    color: #007bff;
    font-weight: 500;
}

.content-meta .date {
    color: #6c757d;
}

.content-platform {
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-platform i {
    font-size: 1.5rem;
    color: #007bff;
}

/* Enhanced Insights */
.insight-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.insight-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.insight-card.success {
    border-left: 4px solid #28a745;
}

.insight-card.warning {
    border-left: 4px solid #ffc107;
}

.insight-card.info {
    border-left: 4px solid #17a2b8;
}

.insight-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border-radius: 50%;
    flex-shrink: 0;
}

.insight-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #212529;
}

.insight-content p {
    margin: 0 0 1rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.insight-action {
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.insight-action:hover {
    background: #0056b3;
}

.insights-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.insight-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 15px;
}

.insight-icon {
    background: #ffc107;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.insight-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #212529;
}

.insight-content p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

/* Common Styles */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.loading i {
    font-size: 24px;
    margin-bottom: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h4 {
    margin: 0 0 8px 0;
    color: #495057;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select[multiple] {
    height: auto;
    min-height: 100px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    background: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-outline {
    border-color: #6c757d;
    color: #6c757d;
}

.btn-outline:hover:not(:disabled) {
    background-color: #6c757d;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-info {
    border-left: 4px solid #007bff;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.notification-content i {
    font-size: 16px;
}

.notification-success .notification-content i {
    color: #28a745;
}

.notification-error .notification-content i {
    color: #dc3545;
}

.notification-info .notification-content i {
    color: #007bff;
}

.notification-close {
    background: none;
    border: none;
    font-size: 14px;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
}

.notification-close:hover {
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    .platform-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .schedule-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .platform-results-grid {
        grid-template-columns: 1fr;
    }
    
    .optimal-times-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .insights-list {
        grid-template-columns: 1fr;
    }
    
    .scheduled-post-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .post-actions {
        align-self: stretch;
        justify-content: flex-end;
    }
    
    .performance-filters {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .platform-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .optimal-times-grid {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
}