/* Product Authenticity Checker - Frontend Styles */

.pac-verification-wrapper {
    max-width: 440px;
    margin: 0 auto;
    padding: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.pac-form-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.pac-form-header {
    padding: 22px 24px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pac-form-header::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.pac-form-header::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.pac-shield-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    animation: pac-pulse 2s infinite;
}

@keyframes pac-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.pac-form-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.pac-form-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
    max-width: 340px;
    margin: 0 auto;
}

.pac-form {
    padding: 20px 24px 24px;
}

.pac-form-group {
    margin-bottom: 16px;
}

.pac-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.pac-input-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.pac-input {
    width: 100% !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    border: 2px solid #d1d5db !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    color: #000000 !important;
    height: 42px !important;
    display: block !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

.pac-input:hover {
    border-color: #4a90d9 !important;
    background: #ffffff !important;
    color: #000000 !important;
}

.pac-input:focus {
    outline: none !important;
    border-color: #667eea !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

.pac-input::placeholder {
    color: #6b7280 !important;
    opacity: 0.7 !important;
}

.pac-input:-webkit-autofill,
.pac-input:-webkit-autofill:hover,
.pac-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #000000 !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

.pac-code-wrap .pac-input {
    padding-left: 12px !important;
}

.pac-code-input {
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: 3px !important;
    text-transform: uppercase !important;
    text-align: center !important;
    font-family: 'SF Mono', 'Courier New', monospace !important;
    background: #ffffff !important;
    color: #000000 !important;
}

.pac-code-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    gap: 8px;
}

.pac-code-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

.pac-code-counter {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    font-family: 'SF Mono', 'Courier New', monospace;
    white-space: nowrap;
}

.pac-code-counter.valid {
    color: #10b981;
}

.pac-code-counter.invalid {
    color: #ef4444;
}

.pac-submit-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

.pac-submit-btn::before {
    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;
}

.pac-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5b6ce4 0%, #6b3f9e 100%);
}

.pac-submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.pac-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.pac-submit-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.pac-btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pac-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pac-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: pac-spin 0.8s linear infinite;
}

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

.pac-form-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 0;
    font-size: 11px;
    color: #9ca3af;
}

.pac-form-group.shake {
    animation: pac-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes pac-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}

.pac-message {
    margin: 14px 24px 20px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

.pac-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.pac-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Modal Styles */
.pac-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    background: transparent !important;
}

.pac-modal.show {
    display: flex !important;
}

.pac-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    animation: pac-fade 0.3s ease;
}

@keyframes pac-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pac-modal-content {
    position: relative !important;
    z-index: 1;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 92% !important;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    text-align: center;
    margin: auto !important;
    animation: pac-modal-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pac-modal-in {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pac-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 300;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.pac-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: rotate(90deg);
}

.pac-result-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pac-result-icon.valid {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #6ee7b7;
}

.pac-result-icon.valid svg,
.pac-check-animation {
    color: #059669;
    font-size: 44px;
    animation: pac-check-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pac-check-pop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.pac-result-icon.invalid {
    background: linear-gradient(135deg, #fef2f2 0%, #fde8e8 100%);
    border: 2px solid #fca5a5;
    color: #dc2626;
    font-size: 40px;
}

.pac-result-icon.used {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fcd34d;
    color: #d97706;
    font-size: 40px;
}

.pac-result-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #111827;
    line-height: 1.3;
}

.pac-result-message {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.pac-product-info {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    margin-top: 24px;
    animation: pac-fade-up 0.4s ease;
}

@keyframes pac-fade-up {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pac-product-info h4 {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pac-product-details {
    display: grid;
    gap: 2px;
}

.pac-product-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.pac-product-detail-row:last-child {
    border-bottom: none;
}

.pac-detail-label {
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    flex-shrink: 0;
    text-transform: capitalize;
}

.pac-detail-value {
    color: #1f2937;
    font-size: 13px;
    text-align: right;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 600px) {
    .pac-verification-wrapper {
        padding: 8px;
    }
    
    .pac-form-header {
        padding: 18px 16px 14px;
    }
    
    .pac-form-title {
        font-size: 19px;
    }
    
    .pac-form {
        padding: 16px 16px 20px;
    }
    
    .pac-shield-icon {
        width: 44px;
        height: 44px;
    }
    
    .pac-code-input {
        font-size: 18px;
        letter-spacing: 3px;
    }
    
    .pac-modal-content {
        padding: 24px 16px;
    }
    
    .pac-result-icon {
        width: 64px;
        height: 64px;
    }
    
    .pac-result-title {
        font-size: 19px;
    }
    
    .pac-message {
        margin: 16px 20px 24px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pac-form-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .pac-form-title {
        color: #ffffff;
    }
    
    .pac-label {
        color: #e5e7eb;
    }
    
    .pac-input {
        background: #ffffff !important;
        border-color: #4b5563 !important;
        color: #000000 !important;
    }
    
    .pac-input:hover {
        background: #ffffff !important;
        border-color: #4a90d9 !important;
        color: #000000 !important;
    }
    
    .pac-input:focus {
        background: #ffffff !important;
        border-color: #667eea !important;
        color: #000000 !important;
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2) !important;
    }
    
    .pac-code-input {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .pac-form-privacy {
        color: #6b7280;
    }
    
    .pac-modal-content {
        background: #1f2937;
    }
    
    .pac-modal-close {
        background: #374151;
        color: #9ca3af;
    }
    
    .pac-modal-close:hover {
        background: #4b5563;
        color: #ffffff;
    }
}
