/* Frontend Styles for Custom Capture Message */

/* Button Wrapper */
.ccm-button-wrapper {
    position: fixed;
    z-index: 9999;
    animation: ccmSlideUp 0.5s ease-out;
}

@keyframes ccmSlideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Button Positions */
.ccm-position-bottom-left {
    bottom: 30px;
    left: 30px;
}

.ccm-position-bottom-center {
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.ccm-position-bottom-right {
    bottom: 30px;
    right: 30px;
}

/* Capture Button */
.ccm-capture-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ccm-capture-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ccm-capture-button:active {
    transform: translateY(-1px);
}

/* Modal */
.ccm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ccm-modal.ccm-modal-open {
    opacity: 1;
}

.ccm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.ccm-modal-container {
    position: relative;
    z-index: 10001;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: ccmModalSlideIn 0.3s ease-out;
}

@keyframes ccmModalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ccm-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.ccm-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.ccm-modal-close:hover {
    background: #f0f0f0;
    color: #000;
}

/* Modal Header */
.ccm-modal-header {
    margin-bottom: 30px;
    text-align: center;
}

.ccm-modal-header h2 {
    margin: 0 0 15px 0;
    font-size: 28px;
    color: #1d2327;
    font-weight: 700;
}

.ccm-modal-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* Form Styles */
.ccm-form {
    width: 100%;
}

.ccm-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.ccm-form-group {
    flex: 1;
    margin-bottom: 20px;
}

.ccm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.ccm-required {
    color: #dc3545;
}

.ccm-form-group input[type="text"],
.ccm-form-group input[type="email"],
.ccm-form-group input[type="tel"],
.ccm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
    box-sizing: border-box;
}

.ccm-form-group input:focus,
.ccm-form-group textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.ccm-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form Message */
.ccm-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    animation: ccmFadeIn 0.3s;
}

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

.ccm-form-message.ccm-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
    display: block;
}

.ccm-form-message.ccm-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #060;
    display: block;
}

/* Submit Button */
.ccm-submit-button {
    width: 100%;
    padding: 16px 32px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.ccm-submit-button:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.ccm-submit-button:active {
    transform: translateY(0);
}

.ccm-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.ccm-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ccmSpin 0.8s linear infinite;
}

@keyframes ccmSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ccm-button-wrapper {
        bottom: 20px;
    }
    
    .ccm-position-bottom-left {
        left: 20px;
    }
    
    .ccm-position-bottom-right {
        right: 20px;
    }
    
    .ccm-capture-button {
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .ccm-modal-content {
        padding: 30px 20px;
    }
    
    .ccm-modal-header h2 {
        font-size: 24px;
    }
    
    .ccm-form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .ccm-position-bottom-center {
        left: 20px;
        right: 20px;
        transform: none;
    }
    
    .ccm-capture-button {
        width: 100%;
        text-align: center;
    }
    
    .ccm-modal-container {
        width: 95%;
    }
    
    .ccm-modal-content {
        padding: 25px 15px;
    }
}

/* Prevent body scroll when modal is open */
body.ccm-modal-active {
    overflow: hidden;
}

/* Device-specific display rules */
@media (min-width: 850px) {
    .ccm-hide-for-desktop {
        display: none !important;
    }
}

@media (max-width: 849px) {
    .ccm-hide-for-mobile {
        display: none !important;
    }
}
