/* Housecall Pro Tipping Page Styles */

/* Reset and base styles */
.hcp-tip-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main container */
.hcp-tip-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

/* Inner card */
.hcp-tip-container > div {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Header section */
.hcp-tip-header {
    margin-bottom: 30px;
}

.hcp-company-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #667eea;
    overflow: hidden;
}

.hcp-company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.hcp-logo-placeholder {
    font-size: 30px;
    color: #667eea;
}

.hcp-company-name {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.hcp-thank-you-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Customer info section */
.hcp-customer-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.hcp-customer-info h2 {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.hcp-job-info {
    font-size: 14px;
    color: #666;
}

/* Tip selection section */
.hcp-tip-section {
    margin-bottom: 30px;
}

.hcp-tip-section h3 {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.hcp-tip-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.hcp-tip-button {
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    outline: none;
}

.hcp-tip-button:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.hcp-tip-button.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.hcp-tip-percentage {
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
}

.hcp-tip-amount {
    font-size: 14px;
    opacity: 0.8;
}

.hcp-tip-button.active .hcp-tip-amount {
    opacity: 1;
}

/* Custom tip input */
.hcp-custom-tip {
    margin-top: 20px;
}

.hcp-custom-tip label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.hcp-custom-tip input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s ease;
    outline: none;
}

.hcp-custom-tip input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Payment section */
.hcp-payment-section {
    margin-top: 30px;
}

.hcp-selected-tip {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #28a745;
}

.hcp-payment-form {
    margin-bottom: 20px;
}

#hcp-card-element {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    transition: border-color 0.3s ease;
}

#hcp-card-element.focused {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#hcp-card-errors {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    text-align: left;
}

/* Payment button */
.hcp-pay-button {
    width: 100%;
    padding: 18px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    outline: none;
}

.hcp-pay-button:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.hcp-pay-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hcp-pay-button:active {
    transform: translateY(0);
}

/* Skip button */
.hcp-skip-button {
    margin-top: 20px;
    padding: 15px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    transition: color 0.3s ease;
    outline: none;
}

.hcp-skip-button:hover {
    color: #333;
}

/* Loading spinner */
.hcp-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

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

.hidden {
    display: none !important;
}

/* Messages */
.hcp-messages {
    margin-top: 20px;
}

.hcp-error,
.hcp-success {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: 500;
}

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

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

.hcp-tip-error,
.hcp-tip-success {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
}

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

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

/* Responsive design */
@media (max-width: 768px) {
    .hcp-tip-container {
        padding: 15px;
    }
    
    .hcp-tip-container > div {
        padding: 30px 20px;
    }
    
    .hcp-tip-buttons {
        grid-template-columns: 1fr;
    }
    
    .hcp-company-name {
        font-size: 20px;
    }
    
    .hcp-thank-you-message {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hcp-tip-container {
        padding: 10px;
    }
    
    .hcp-tip-container > div {
        padding: 25px 15px;
        border-radius: 15px;
    }
    
    .hcp-company-logo {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .hcp-company-name {
        font-size: 18px;
    }
    
    .hcp-thank-you-message {
        font-size: 14px;
    }
    
    .hcp-tip-button {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .hcp-tip-percentage {
        font-size: 16px;
    }
    
    .hcp-tip-amount {
        font-size: 12px;
    }
}

/* Animation effects */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hcp-payment-section {
    animation: fadeIn 0.5s ease-out;
}

/* Focus states for accessibility */
.hcp-tip-button:focus,
.hcp-custom-tip input:focus,
.hcp-pay-button:focus,
.hcp-skip-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hcp-tip-container > div {
        border: 2px solid #000;
    }
    
    .hcp-tip-button {
        border-color: #000;
    }
    
    .hcp-tip-button:hover {
        border-color: #000;
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hcp-tip-button,
    .hcp-custom-tip input,
    .hcp-pay-button,
    .hcp-skip-button {
        transition: none;
    }
    
    .hcp-tip-button:hover,
    .hcp-pay-button:hover {
        transform: none;
    }
    
    .hcp-spinner {
        animation: none;
    }
    
    .hcp-payment-section {
        animation: none;
    }
}