/**
 * Frontend CSS for Sycall Native
 */

/* Container Styles */
.sycall-native-container {
    max-width: 400px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sycall-native-sms-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Form Styles */
.sycall-native-form,
.sycall-native-sms-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sycall-native-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sycall-native-field label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.sycall-native-field input,
.sycall-native-field textarea {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.sycall-native-field input:focus,
.sycall-native-field textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.sycall-native-field input[type="tel"] {
    font-family: monospace;
}

.sycall-native-field textarea {
    min-height: 80px;
    resize: vertical;
}

/* Consent Checkbox */
.sycall-native-consent {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}

.sycall-native-consent input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
    width: auto;
}

.sycall-native-consent label {
    font-weight: normal;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    cursor: pointer;
}

/* Button Styles */
.sycall-native-submit-btn,
.sycall-native-quick-call {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sycall-native-submit-btn:hover,
.sycall-native-quick-call:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.sycall-native-submit-btn:active,
.sycall-native-quick-call:active {
    transform: translateY(0);
}

.sycall-native-submit-btn:disabled,
.sycall-native-quick-call:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Quick Call Specific Styles */
.sycall-native-quick-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 5px 0;
}

.sycall-native-quick-call {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 20px;
}

.sycall-native-quick-btn {
    background: #28a745;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 16px;
}

.sycall-native-quick-btn:hover {
    background: #218838;
}

/* Result Messages */
.sycall-native-result {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
}

.sycall-native-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.sycall-native-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.sycall-native-icon {
    margin-right: 6px;
}

/* Simple Container */
.sycall-native-simple {
    display: inline-block;
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .sycall-native-container {
        max-width: 100%;
        margin: 15px 0;
    }
    
    .sycall-native-sms-container {
        padding: 15px;
        margin: 0 -5px;
    }
    
    .sycall-native-field input,
    .sycall-native-field textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .sycall-native-submit-btn,
    .sycall-native-quick-call {
        width: 100%;
        padding: 14px 24px;
    }
    
    .sycall-native-quick-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .sycall-native-quick-call {
        width: 100%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .sycall-native-sms-container {
        background: #1a1a1a;
        border-color: #444;
        color: #fff;
    }
    
    .sycall-native-field label {
        color: #fff;
    }
    
    .sycall-native-field input,
    .sycall-native-field textarea {
        background: #2a2a2a;
        border-color: #555;
        color: #fff;
    }
    
    .sycall-native-field input:focus,
    .sycall-native-field textarea:focus {
        border-color: #007cba;
        background: #333;
    }
    
    .sycall-native-consent label {
        color: #ccc;
    }
}

/* Animation for success/error messages */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sycall-native-result {
    animation: slideDown 0.3s ease;
}

/* Loading state animation */
.sycall-native-submit-btn:disabled,
.sycall-native-quick-call:disabled {
    position: relative;
    overflow: hidden;
}

.sycall-native-submit-btn:disabled::after,
.sycall-native-quick-call:disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { 
        left: -100%; 
    }
    100% { 
        left: 100%; 
    }
}

/* Accessibility improvements */
.sycall-native-field input:invalid,
.sycall-native-field textarea:invalid {
    border-color: #dc3545;
}

.sycall-native-field input:invalid:focus,
.sycall-native-field textarea:invalid:focus {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sycall-native-submit-btn,
    .sycall-native-quick-call {
        border: 2px solid #000;
    }
    
    .sycall-native-field input,
    .sycall-native-field textarea {
        border: 2px solid #000;
    }
    
    .sycall-native-success {
        border: 2px solid #000;
    }
    
    .sycall-native-error {
        border: 2px solid #000;
    }
}

/* Print styles */
@media print {
    .sycall-native-container {
        display: none;
    }
}