/* Updated SSL-specific styles - Certificate-Focused Design with Raw Data Display */

/* SSL Card Base Styles */
.ssl-card {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

body.light-mode .ssl-card {
    background: white;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ssl-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.light-mode .ssl-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* SSL Header */
.ssl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ssl-domain-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: #4285f4;
    margin: 0;
}

/* Security Grade Badges */
.ssl-grade {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    min-width: 35px;
    text-align: center;
    position: relative;
}

.grade-aplus { background: #4caf50; color: white; }
.grade-a { background: #8bc34a; color: white; }
.grade-b { background: #cddc39; color: #333; }
.grade-c { background: #ff9800; color: white; }
.grade-d { background: #ff5722; color: white; }
.grade-f { background: #f44336; color: white; }
.grade-unknown { background: #666; color: #ccc; }

/* Add certificate icon to grade badges */
.ssl-grade::before {
    content: "🔒";
    margin-right: 4px;
    font-size: 12px;
}

.grade-f::before,
.grade-d::before {
    content: "🔓";
}

/* SSL Info Grid */
.ssl-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

.ssl-info-item {
    text-align: center;
}

.ssl-info-label {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

body.light-mode .ssl-info-label {
    color: #666;
}

.ssl-info-value {
    font-weight: 500;
    color: #e0e0e0;
}

body.light-mode .ssl-info-value {
    color: #333;
}

/* Scanner Method Badge */
.scanner-method-badge {
    background: #4285f4;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Status Indicators */
.ssl-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ssl-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-ok { background: #4caf50; }
.status-warning { background: #ff9800; }
.status-critical { background: #f44336; }
.status-unknown { background: #666; }

/* Expiry Status */
.expiry-status {
    font-weight: 500;
}

.expiry-ok { color: #4caf50; }
.expiry-warning { color: #ff9800; }
.expiry-critical { color: #f44336; }

/* Text Color Classes */
.text-success { color: #4caf50; }
.text-warning { color: #ff9800; }
.text-critical { color: #f44336; }
.text-high { color: #ff5722; }
.text-medium { color: #ff9800; }
.text-low { color: #9c27b0; }

/* SSL Details Container */
.ssl-details {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

body.light-mode .ssl-details {
    border-top: 1px solid #eee;
}

.ssl-details.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

/* SSL Tabs */
.ssl-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
}

body.light-mode .ssl-tabs {
    border-bottom: 1px solid #eee;
}

.ssl-tab {
    padding: 10px 15px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
}

.ssl-tab.active {
    color: #4285f4;
    border-bottom-color: #4285f4;
}

body.light-mode .ssl-tab {
    color: #666;
}

body.light-mode .ssl-tab.active {
    color: #4285f4;
}

/* Tab Content */
.ssl-tab-content {
    display: none;
}

.ssl-tab-content.active {
    display: block;
}

/* Certificate Info Grid */
.cert-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.cert-info-section {
    background: #333;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #4285f4;
}

body.light-mode .cert-info-section {
    background: #f9f9f9;
    border-left-color: #4285f4;
}

.cert-info-title {
    font-size: 14px;
    font-weight: 600;
    color: #4285f4;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cert-info-title::before {
    content: "📋";
    font-size: 16px;
}

.cert-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cert-info-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px solid #444;
}

body.light-mode .cert-info-list li {
    border-bottom: 1px solid #eee;
}

.cert-info-list li:last-child {
    border-bottom: none;
}

.cert-info-label {
    color: #ccc;
    font-weight: 500;
    min-width: 40%;
}

body.light-mode .cert-info-label {
    color: #666;
}

.cert-info-value {
    color: #e0e0e0;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

body.light-mode .cert-info-value {
    color: #333;
}

/* Subject Alternative Names */
.san-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.san-item {
    background: #4285f4;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

body.light-mode .san-item {
    background: #4285f4;
    color: white;
}

/* Security Issues */
.security-issues {
    margin-top: 15px;
}

.security-issue {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.issue-critical {
    background: rgba(244, 67, 54, 0.1);
    border-left: 3px solid #f44336;
}

.issue-high {
    background: rgba(255, 87, 34, 0.1);
    border-left: 3px solid #ff5722;
}

.issue-medium {
    background: rgba(255, 152, 0, 0.1);
    border-left: 3px solid #ff9800;
}

.issue-low {
    background: rgba(156, 39, 176, 0.1);
    border-left: 3px solid #9c27b0;
}

.issue-icon {
    font-weight: bold;
    width: 16px;
    text-align: center;
}

.issue-critical .issue-icon { color: #f44336; }
.issue-high .issue-icon { color: #ff5722; }
.issue-medium .issue-icon { color: #ff9800; }
.issue-low .issue-icon { color: #9c27b0; }

/* No Issues Message */
.no-issues {
    text-align: center;
    padding: 20px;
    color: #4caf50;
    font-weight: 500;
}

.no-issues::before {
    content: "✅";
    margin-right: 8px;
}

/* Certificate Chain Visualization */
.cert-chain {
    margin-top: 15px;
}

.chain-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    margin-bottom: 8px;
    background: #333;
    border-radius: 4px;
    border-left: 4px solid #4285f4;
}

body.light-mode .chain-item {
    background: #f9f9f9;
}

.chain-position {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #4285f4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.chain-info {
    flex: 1;
}

.chain-subject {
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 2px;
}

body.light-mode .chain-subject {
    color: #333;
}

.chain-details {
    font-size: 12px;
    color: #888;
}

body.light-mode .chain-details {
    color: #666;
}

/* Raw Certificate Data Styles */
.raw-cert-toggle {
    margin-bottom: 15px;
}

.raw-cert-data {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #e0e0e0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 600px;
    overflow-y: auto;
    position: relative;
}

body.light-mode .raw-cert-data {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #212529;
}

/* Raw data scrollbar styling */
.raw-cert-data::-webkit-scrollbar {
    width: 8px;
}

.raw-cert-data::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

body.light-mode .raw-cert-data::-webkit-scrollbar-track {
    background: #f1f3f4;
}

.raw-cert-data::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

body.light-mode .raw-cert-data::-webkit-scrollbar-thumb {
    background: #c1c1c1;
}

.raw-cert-data::-webkit-scrollbar-thumb:hover {
    background: #777;
}

body.light-mode .raw-cert-data::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Enhanced Button Styles */
.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    border: 1px solid #4285f4;
    background: #4285f4;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-small:hover {
    background: #3367d6;
    border-color: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.btn-small.secondary {
    background: transparent;
    color: #888;
    border-color: #555;
}

.btn-small.secondary:hover {
    background: #555;
    color: #fff;
    border-color: #555;
}

body.light-mode .btn-small.secondary {
    color: #666;
    border-color: #ddd;
}

body.light-mode .btn-small.secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

/* No Data Messages */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
}

body.light-mode .no-data {
    color: #666;
}

.no-ssl-domains {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

body.light-mode .no-ssl-domains {
    color: #666;
}

.no-ssl-domains h3 {
    margin-bottom: 10px;
    color: #666;
}

body.light-mode .no-ssl-domains h3 {
    color: #888;
}

/* Security Level Indicators */
.level-secure { color: #4caf50; font-weight: 600; }
.level-weak { color: #ff9800; font-weight: 600; }
.level-insecure { color: #f44336; font-weight: 600; }
.level-unknown { color: #666; font-weight: 600; }

/* Loading Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 800px;
    }
}

/* Enhanced Loading Spinner */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    position: relative;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #333;
    border-radius: 50%;
    border-top-color: #4285f4;
    animation: spin 1s linear infinite;
}

body.light-mode .loading::after {
    border-color: #ddd;
    border-top-color: #4285f4;
}

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

/* Error Message */
.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    font-size: 14px;
    text-align: center;
}

/* Copy Success/Error Styling */
.temp-message {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Raw Data Section Enhancements */
.raw-cert-data {
    position: relative;
}

.raw-cert-data::before {
    content: "SSL Certificate Raw Data";
    position: absolute;
    top: -30px;
    left: 0;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

body.light-mode .raw-cert-data::before {
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ssl-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .cert-info-grid {
        grid-template-columns: 1fr;
    }
    
    .ssl-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .ssl-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .chain-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .raw-cert-data {
        font-size: 11px;
        padding: 15px;
        max-height: 400px;
    }
    
    .btn-small {
        padding: 6px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ssl-info {
        grid-template-columns: 1fr;
    }
    
    .ssl-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ssl-grade {
        align-self: flex-end;
    }
    
    .san-list {
        flex-direction: column;
    }
    
    .raw-cert-toggle {
        text-align: center;
    }
    
    .raw-cert-toggle .btn-small {
        display: block;
        width: 100%;
        margin-bottom: 8px;
    }
}

/* Enhanced Grade Indicators */
.ssl-grade {
    position: relative;
    overflow: hidden;
}

.ssl-grade::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.ssl-grade:hover::after {
    left: 100%;
}

/* Focus States for Accessibility */
.ssl-tab:focus,
.btn-small:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .ssl-card {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .ssl-details {
        display: block !important;
    }
    
    .ssl-tabs {
        display: none;
    }
    
    .ssl-tab-content {
        display: block !important;
    }
    
    .raw-cert-toggle {
        display: none;
    }
    
    .raw-cert-data {
        background: white !important;
        border: 1px solid #000 !important;
        color: #000 !important;
        font-size: 10px;
        max-height: none;
        page-break-inside: avoid;
    }
}

/* Dark Theme Enhancements */
body:not(.light-mode) .ssl-card {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
}

body:not(.light-mode) .cert-info-section {
    background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
}

/* Light Theme Enhancements */
body.light-mode .ssl-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

body.light-mode .cert-info-section {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
}