/* Synaptic Warranty Manager - Frontend Styles */

/* My Account Menu Icon for Garantii */
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--garantii a::before {
    content: "\f332";
    font-family: dashicons;
    margin-right: 0.5em;
    vertical-align: middle;
    line-height: 1;
}

/* Alternative: Shield icon using WooCommerce icon font */
.woocommerce-MyAccount-navigation-link--garantii a::before {
    content: "\e028";
    font-family: WooCommerce;
    speak: never;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    margin-right: .618em;
    text-decoration: none;
}

/* Container */
.swm-warranties-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Header */
.swm-warranties-header {
    text-align: center;
    margin-bottom: 40px;
}

.swm-warranties-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.swm-subtitle {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Empty State */
.swm-no-warranties {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
}

.swm-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.swm-no-warranties h3 {
    font-size: 22px;
    color: #495057;
    margin: 0 0 10px 0;
}

.swm-no-warranties p {
    color: #6c757d;
    max-width: 400px;
    margin: 0 auto;
}

/* Grid */
.swm-warranties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Cards */
.swm-warranty-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.swm-warranty-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

/* Card Status Borders */
.swm-warranty-card.swm-status-active {
    border-top: 4px solid #28a745;
}

.swm-warranty-card.swm-status-warning {
    border-top: 4px solid #ffc107;
}

.swm-warranty-card.swm-status-critical {
    border-top: 4px solid #fd7e14;
}

.swm-warranty-card.swm-status-expired {
    border-top: 4px solid #dc3545;
    opacity: 0.85;
}

/* Card Header */
.swm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 20px 15px;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
    border-bottom: 1px solid #f0f0f0;
}

.swm-product-name {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    flex: 1;
    padding-right: 15px;
    line-height: 1.3;
}

.swm-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Card Body */
.swm-card-body {
    padding: 20px;
}

.swm-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.swm-info-row:last-of-type {
    border-bottom: none;
}

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

.swm-value {
    font-weight: 600;
    color: #212529;
    font-size: 14px;
}

.swm-serial {
    font-family: 'Monaco', 'Consolas', monospace;
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* Timer Section */
.swm-timer-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px;
    text-align: center;
}

.swm-timer-active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.swm-days-remaining {
    margin-bottom: 15px;
}

.swm-days-number {
    font-size: 48px;
    font-weight: 800;
    color: #212529;
    line-height: 1;
    display: block;
}

.swm-days-label {
    font-size: 14px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.swm-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.swm-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.swm-progress-text {
    font-size: 12px;
    color: #6c757d;
}

.swm-timer-expired {
    padding: 15px;
    background: #fff5f5;
    border-radius: 8px;
    color: #dc3545;
}

.swm-timer-icon {
    font-size: 24px;
    margin-right: 10px;
}

.swm-timer-text {
    font-weight: 600;
}

/* Card Footer */
.swm-card-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px 20px;
    background: #fafbfc;
}

.swm-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.swm-btn-icon {
    margin-right: 8px;
    font-size: 16px;
}

.swm-btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
    color: #fff;
}

.swm-btn-primary:hover {
    background: linear-gradient(135deg, #0077ee 0%, #0055aa 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    color: #fff;
}

.swm-btn-secondary {
    background: #fff;
    color: #495057;
    border: 2px solid #dee2e6;
}

.swm-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
}

/* Legend */
.swm-legend {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.swm-legend h4 {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swm-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.swm-legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #495057;
}

.swm-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Modal */
.swm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.swm-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.swm-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.swm-modal-close:hover {
    background: #f8f9fa;
    transform: scale(1.1);
}

#swm-certificate-iframe {
    width: 100%;
    height: 100%;
}

/* Loading State */
.swm-btn.swm-loading {
    opacity: 0.7;
    pointer-events: none;
}

.swm-btn.swm-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: swm-spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .swm-warranties-grid {
        grid-template-columns: 1fr;
    }
    
    .swm-card-footer {
        flex-direction: column;
    }
    
    .swm-days-number {
        font-size: 36px;
    }
    
    .swm-legend-items {
        flex-direction: column;
        gap: 10px;
    }
    
    .swm-modal-content {
        width: 95%;
        height: 90vh;
        border-radius: 8px;
    }
}

/* Print Styles */
@media print {
    .swm-card-footer {
        display: none;
    }
    
    .swm-warranty-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
