/**
 * Site Detail Page Styles - CrawlRabbit
 * Enterprise-grade styles for site detail pages with SSL info
 */

/* ========== Enhanced Page Styling ========== */
.content-card {
    max-width: 1200px;
}

h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
    margin: 30px 0 20px 0;
}

.last-updated {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 30px;
}

/* ========== Status Badges ========== */
.status-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.badge {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ========== Alerts ========== */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 25px;
    display: flex;
    align-items: start;
    gap: 12px;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #f39c12;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #e74c3c;
}

.alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* ========== Security Score Display ========== */
.score-display {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin: 20px 0;
}

.score-number {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 18px;
    margin-top: 10px;
    opacity: 0.9;
}

/* ========== Grid Layouts ========== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

/* ========== Info Cards ========== */
.info-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.info-card h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.metric {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.metric:last-child {
    border-bottom: none;
}

.metric-label {
    color: #6c757d;
    font-size: 14px;
}

.metric-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.status-warning {
    color: #f39c12;
    font-weight: 600;
}

.status-error {
    color: #e74c3c;
    font-weight: 600;
}

/* ========== Security Issues ========== */
.security-issue {
    background: white;
    padding: 15px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.security-issue h4 {
    color: #e74c3c;
    font-size: 16px;
    margin-bottom: 5px;
}

.security-issue p {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 5px 0;
}

/* ========== Recommendation Box ========== */
.recommendation-box {
    background: #e8f4f8;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    margin-top: 15px;
}

.recommendation-box h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.recommendation-box ul {
    margin-left: 20px;
    color: #555;
}

.recommendation-box li {
    margin: 8px 0;
}

/* ========== Compliance Grid ========== */
.compliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.compliance-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    text-align: center;
}

.compliance-item.compliant {
    border-color: #27ae60;
    background: #d4edda;
}

.compliance-item.non-compliant {
    border-color: #e74c3c;
    background: #f8d7da;
}

.compliance-item.partial {
    border-color: #f39c12;
    background: #fff3cd;
}

.compliance-item h4 {
    margin-bottom: 8px;
    font-size: 16px;
    color: #2c3e50;
}

.compliance-item .status {
    font-weight: 600;
    font-size: 14px;
}

.compliance-item p {
    font-size: 13px;
    margin-top: 8px;
    color: #555;
}

/* ========== Timeline for SSL History ========== */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3498db;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #3498db;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 17px;
    width: 2px;
    height: calc(100% + 3px);
    background: #e0e0e0;
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-date {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.timeline-content {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #2c3e50;
}

/* ========== Enhanced Table Styling ========== */
.table tr {
    border-bottom: 1px solid #ecf0f1;
}

.table td {
    padding: 15px 10px;
}

.table td:first-child {
    font-weight: 600;
    color: #555;
    width: 250px;
}

.table td:last-child {
    color: #2c3e50;
}

/* ========== Compact Info Table ========== */
.compact-info-table {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.compact-info-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.compact-info-table tr:last-child {
    border-bottom: none;
}

.compact-info-table td {
    padding: 12px 16px;
    vertical-align: top;
}

.compact-info-table td:first-child {
    font-weight: 600;
    color: #555;
    width: 180px;
    background: #f8f9fa;
}

.compact-info-table td:last-child {
    color: #2c3e50;
    line-height: 1.6;
}

/* ========== SSL Refresh Button ========== */
.btn-refresh-ssl {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
    padding: 6px 14px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-left: 15px;
}

.btn-refresh-ssl:hover {
    background: #3498db;
    color: white;
    transform: translateY(-1px);
}

.btn-refresh-ssl:active {
    transform: translateY(0);
}

.btn-refresh-ssl:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    border-color: #95a5a6;
}

.btn-refresh-ssl.loading svg {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== SSL Grade Badges ========== */
.ssl-grade-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    color: white;
}

.ssl-grade-badge.grade-a\+,
.ssl-grade-badge.grade-a-plus {
    background: #27ae60;
}

.ssl-grade-badge.grade-a {
    background: #2ecc71;
}

.ssl-grade-badge.grade-b {
    background: #3498db;
}

.ssl-grade-badge.grade-c {
    background: #f39c12;
}

.ssl-grade-badge.grade-d {
    background: #e67e22;
}

.ssl-grade-badge.grade-e {
    background: #e74c3c;
}

.ssl-grade-badge.grade-f {
    background: #c0392b;
}

/* ========== Enhanced Button Styling ========== */
.website-link {
    display: inline-block;
    margin: 30px 0;
}

/* ========== Table Enhancements (for SSL history) ========== */
.table thead {
    background: #ecf0f1;
}

.table thead th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
}

.table tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

.table tbody td {
    padding: 10px 12px;
}

/* ========== SSL Refresh Messages ========== */
#ssl-refresh-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

#ssl-refresh-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#ssl-refresh-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .table td:first-child {
        width: auto;
    }

    .compact-info-table td:first-child {
        width: 120px;
        font-size: 13px;
    }

    .compact-info-table td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .score-number {
        font-size: 56px;
    }

    .score-label {
        font-size: 14px;
    }

    .score-display {
        padding: 20px;
        margin: 15px 0;
    }

    h2 {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-refresh-ssl {
        margin-left: 0;
        margin-top: 10px;
    }

    .status-badges {
        gap: 6px;
    }

    .badge {
        font-size: 11px;
        padding: 5px 10px;
    }
}
