/**
 * SSL Check Match Specific Styles - COMPLETELY ENHANCED v2.1
 * 
 * @package CSR_Tools
 * @since 2.0.0
 * @updated 2.1.0 - Professional card layouts, smooth animations
 * 
 * FEATURES:
 * - Professional comparison tables
 * - Visual hash comparison
 * - Smooth animations
 * - Responsive design
 * - Status indicators
 */

/* ==========================================================================
   Check Type Selection - Radio Cards
   ========================================================================== */
.check-type-selection {
    display: grid;
    gap: 16px;
    margin-bottom: 32px;
}

.check-type-card {
    position: relative;
    padding: 20px;
    background: #f8f9fa;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.check-type-card:hover {
    border-color: #2271b1;
    background: #e7f3ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 113, 177, 0.15);
}

.check-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.check-type-card input[type="radio"]:checked + .check-type-content {
    border-left-color: #2271b1;
}

.check-type-card input[type="radio"]:checked ~ .check-indicator {
    background: #2271b1;
    transform: scale(1);
}

.check-type-card input[type="radio"]:checked {
    & + .check-type-content::before {
        content: '✓';
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 32px;
        background: #2271b1;
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 18px;
    }
}

.check-type-content {
    position: relative;
    padding-left: 16px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.check-type-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #222222;
    margin-bottom: 8px;
}

.check-type-icon {
    font-size: 28px;
}

.check-type-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

.check-type-card input[type="radio"]:checked + .check-type-content {
    background: linear-gradient(90deg, rgba(34, 113, 177, 0.05) 0%, transparent 100%);
    padding-left: 20px;
}

/* ==========================================================================
   File Upload Areas
   ========================================================================== */
.file-upload-group {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

.file-upload-item {
    position: relative;
    transition: all 0.3s ease;
}

.file-upload-item.hidden {
    display: none;
}

.file-upload-item.show {
    animation: slideInUp 0.4s ease forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #222222;
    font-size: 16px;
    margin-bottom: 12px;
}

.file-upload-icon {
    font-size: 24px;
    color: #2271b1;
}

.required-badge {
    background: #dc3545;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.file-input-wrapper {
    position: relative;
}

.file-input-custom {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-custom:hover {
    border-color: #2271b1;
    background: #e7f3ff;
    transform: translateY(-2px);
}

.file-input-custom input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-input-display {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-placeholder {
    color: #6c757d;
    font-size: 14px;
}

.file-selected {
    color: #28a745;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-select-btn {
    padding: 8px 16px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-select-btn:hover {
    background: #1c5a8f;
    transform: translateY(-1px);
}

/* ==========================================================================
   Result Container - Match/Mismatch Display
   ========================================================================== */
.match-result-container {
    margin-top: 40px;
    animation: fadeInScale 0.5s ease forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#check-match-result h4, #check-match-result h3 {
    color: #222222;
}

/* Match Status Banner */
.match-status-banner {
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.match-status-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
}

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

.match-status-banner.match {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 3px solid #28a745;
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.3);
}

.match-status-banner.mismatch {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 3px solid #dc3545;
    box-shadow: 0 8px 24px rgba(220, 53, 69, 0.3);
}

.match-status-icon {
    font-size: 80px;
    margin-bottom: 16px;
    display: inline-block;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.match-status-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.match-status-banner.match .match-status-title {
    color: #155724;
}

.match-status-banner.mismatch .match-status-title {
    color: #721c24;
}

.match-status-description {
    font-size: 18px;
    position: relative;
    z-index: 1;
}

.match-status-banner.match .match-status-description {
    color: #155724;
}

.match-status-banner.mismatch .match-status-description {
    color: #721c24;
}

/* ==========================================================================
   Comparison Cards Grid
   ========================================================================== */
.comparison-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .comparison-grid.two-column {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-grid.three-column {
        grid-template-columns: repeat(3, 1fr);
    }
}

.comparison-card {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.comparison-card:hover {
    border-color: #2271b1;
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.15);
    transform: translateY(-4px);
}

.comparison-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #72aee6 0%, #2271b1 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.comparison-card:hover::before {
    transform: scaleX(1);
}

.comparison-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f8f9fa;
}

.comparison-card-icon {
    font-size: 36px;
}

.comparison-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #222222;
}

.comparison-card-body {
    display: grid;
    gap: 16px;
}

.info-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.info-row:hover {
    background: #e7f3ff;
    transform: translateX(4px);
}

.info-label {
    font-weight: 700;
    color: #6c757d;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-weight: 600;
    color: #222222;
    word-break: break-all;
}

.info-value code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: #2271b1;
    border: 1px solid #dee2e6;
    display: inline-block;
}

/* ==========================================================================
   Hash Comparison Visual
   ========================================================================== */
.hash-comparison-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 16px;
    padding: 32px;
    margin: 32px 0;
}

.hash-comparison-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: #222222;
    margin-bottom: 24px;
}

.hash-comparison-visual {
    display: grid;
    gap: 16px;
}

.hash-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.hash-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hash-item.csr {
    border-left-color: #72aee6;
}

.hash-item.key {
    border-left-color: #28a745;
}

.hash-item.cert {
    border-left-color: #9b51e0;
}

.hash-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #222222;
    margin-bottom: 12px;
    font-size: 15px;
}

.hash-label-icon {
    font-size: 24px;
}

.hash-value {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #2271b1;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    word-break: break-all;
    border: 1px solid #dee2e6;
}

.hash-match-indicator {
    text-align: center;
    margin: 24px 0;
    padding: 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 18px;
}

.hash-match-indicator.match {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
}

.hash-match-indicator.mismatch {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #dc3545;
}

/* ==========================================================================
   Individual Match Status (for all_three check)
   ========================================================================== */
.individual-matches-grid {
    display: grid;
    gap: 16px;
    margin: 24px 0;
}

@media (min-width: 768px) {
    .individual-matches-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.match-status-item {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.match-status-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.match-status-item.match {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
}

.match-status-item.mismatch {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
}

.match-status-item-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.match-status-item-label {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.match-status-item.match .match-status-item-label {
    color: #155724;
}

.match-status-item.mismatch .match-status-item-label {
    color: #721c24;
}

.match-status-item-value {
    font-weight: 800;
    font-size: 16px;
}

.match-status-item.match .match-status-item-value {
    color: #28a745;
}

.match-status-item.mismatch .match-status-item-value {
    color: #dc3545;
}

/* ==========================================================================
   Certificate Details Card
   ========================================================================== */
.cert-details-card {
    background: linear-gradient(135deg, #e7f3ff 0%, #d4edff 100%);
    border: 2px solid #2271b1;
    border-left: 6px solid #2271b1;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.cert-details-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.cert-details-icon {
    font-size: 32px;
}

.cert-details-title {
    font-size: 20px;
    font-weight: 700;
    color: #0c5460;
}

.cert-details-grid {
    display: grid;
    gap: 12px;
}

@media (min-width: 768px) {
    .cert-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cert-detail-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border-left: 3px solid #2271b1;
}

.cert-detail-label {
    font-size: 12px;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.cert-detail-value {
    font-size: 16px;
    font-weight: 700;
    color: #222222;
}

.cert-validity-warning {
    margin-top: 16px;
    padding: 16px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
}

.cert-validity-warning.expired {
    background: #f8d7da;
    border-left-color: #dc3545;
}

/* ==========================================================================
   Recommendations Section
   ========================================================================== */
.recommendations-section {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 28px;
    margin: 32px 0;
}

.recommendations-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f8f9fa;
}

.recommendations-icon {
    font-size: 32px;
}

.recommendations-title {
    font-size: 22px;
    font-weight: 800;
    color: #222222;
}

.recommendation-item {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recommendation-item.success {
    background: #d4edda;
    border-left-color: #28a745;
}

.recommendation-item.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.recommendation-item.danger {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.recommendation-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.recommendation-icon {
    font-size: 24px;
}

.recommendation-item.success .recommendation-text {
    color: #155724;
}

.recommendation-item.warning .recommendation-text {
    color: #856404;
}

.recommendation-item.danger .recommendation-text {
    color: #721c24;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */
.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 32px 0;
}

.result-action-btn {
    flex: 1;
    min-width: 200px;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.result-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.result-action-btn.primary {
    background: linear-gradient(135deg, #72aee6 0%, #2271b1 100%);
    color: white;
}

.result-action-btn.secondary {
    background: #6c757d;
    color: white;
}

.result-action-btn.success {
    background: #28a745;
    color: white;
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.checking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    backdrop-filter: blur(4px);
}

.checking-content {
    text-align: center;
    color: white;
}

.checking-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.checking-text {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.checking-subtext {
    font-size: 16px;
    opacity: 0.9;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 767px) {
    .match-status-banner {
        padding: 24px 16px;
    }
    
    .match-status-icon {
        font-size: 60px;
    }
    
    .match-status-title {
        font-size: 24px;
    }
    
    .match-status-description {
        font-size: 16px;
    }
    
    .comparison-card {
        padding: 16px;
    }
    
    .info-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .hash-comparison-section {
        padding: 20px 16px;
    }
    
    .result-action-btn {
        min-width: 100%;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .check-type-selection,
    .file-upload-group,
    .result-actions,
    button {
        display: none !important;
    }
    
    .match-result-container {
        display: block !important;
    }
    
    .comparison-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}