/**
 * Frontend Styles for Spot Communication Manager
 * Mobile-responsive design with modern UI
 */

/* Base Styles */
.spot-communication-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.spot-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.spot-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spot-form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.spot-input,
.spot-textarea {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

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

.spot-textarea {
    resize: vertical;
    min-height: 100px;
}

.spot-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-height: 48px;
    line-height: 1.2;
}

.spot-button-primary {
    background: #007cba;
    color: white;
}

.spot-button-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.spot-button-secondary {
    background: #6c757d;
    color: white;
}

.spot-button-secondary:hover {
    background: #545b62;
}

.spot-button-link {
    background: transparent;
    color: #007cba;
    text-decoration: underline;
}

.spot-button-link:hover {
    color: #005a87;
}

.spot-form-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 500;
    margin-top: 10px;
    display: none;
}

.spot-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.spot-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.spot-form-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* OTP Specific Styles */
.spot-otp-verification {
    animation: slideDown 0.3s ease;
}

.spot-otp-input {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
}

.spot-otp-timer {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin-top: 10px;
}

.spot-countdown {
    font-weight: bold;
    color: #dc3545;
}

/* Button States */
.spot-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.spot-button.loading {
    position: relative;
    color: transparent;
}

.spot-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.spot-button.pulse {
    animation: pulse 2s infinite;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .spot-communication-form {
        margin: 10px;
        padding: 15px;
        border-radius: 6px;
    }
    
    .spot-input,
    .spot-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .spot-button {
        width: 100%;
        padding: 16px 24px;
        font-size: 18px;
    }
    
    .spot-otp-input {
        font-size: 20px;
        letter-spacing: 2px;
    }
    
    .spot-form-group {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .spot-communication-form {
        margin: 5px;
        padding: 10px;
    }
    
    .spot-input,
    .spot-textarea {
        padding: 12px 14px;
    }
    
    .spot-button {
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .spot-communication-form {
        background: #1a1a1a;
        color: #fff;
        border: 1px solid #333;
    }
    
    .spot-input,
    .spot-textarea {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .spot-input:focus,
    .spot-textarea:focus {
        border-color: #007cba;
        background: #333;
    }
    
    .spot-form-group label {
        color: #fff;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .spot-input,
    .spot-textarea {
        border-width: 3px;
    }
    
    .spot-button {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .spot-button,
    .spot-input,
    .spot-textarea {
        transition: none;
    }
    
    .spot-otp-verification {
        animation: none;
    }
    
    .spot-button.loading::after {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .spot-communication-form {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .spot-button {
        display: none;
    }
}

/* Loading States */
.spot-form.loading .spot-input,
.spot-form.loading .spot-textarea {
    opacity: 0.6;
    pointer-events: none;
}

.spot-form.loading .spot-button {
    opacity: 0.8;
    pointer-events: none;
}

/* Success States */
.spot-form.success .spot-input,
.spot-form.success .spot-textarea {
    border-color: #28a745;
}

/* Error States */
.spot-form.error .spot-input,
.spot-form.error .spot-textarea {
    border-color: #dc3545;
}

/* Accessibility Improvements */
.spot-input:focus,
.spot-textarea:focus,
.spot-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.spot-button:focus:not(:focus-visible) {
    outline: none;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Form Validation Styles */
.spot-input.invalid,
.spot-textarea.invalid {
    border-color: #dc3545;
    background: #fff5f5;
}

.spot-input.valid,
.spot-textarea.valid {
    border-color: #28a745;
    background: #f8fff8;
}

/* Custom Checkbox and Radio Styles */
.spot-checkbox,
.spot-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.spot-checkbox input,
.spot-radio input {
    margin: 0;
    width: 18px;
    height: 18px;
}

/* Progress Bar */
.spot-progress {
    width: 100%;
    height: 4px;
    background: #e1e5e9;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.spot-progress-bar {
    height: 100%;
    background: #007cba;
    transition: width 0.3s ease;
}

/* Tooltip */
.spot-tooltip {
    position: relative;
    display: inline-block;
}

.spot-tooltip .spot-tooltip-text {
    visibility: hidden;
    width: 200px;
    background: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.spot-tooltip:hover .spot-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Responsive Grid */
.spot-grid {
    display: grid;
    gap: 20px;
}

.spot-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.spot-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 768px) {
    .spot-grid-2,
    .spot-grid-3 {
        grid-template-columns: 1fr;
    }
}

