/**
 * Frontend Styles for WooCommerce Gift Hint
 */

/* Gift Hint Button */
.wgh-gift-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 400;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wgh-gift-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.wgh-gift-button i {
    font-size: 20px;
}

.wgh-gift-button:active {
    transform: translateY(0);
}

/* Modal Overlay */
.wgh-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.wgh-modal.active {
    display: block;
}

.wgh-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

/* Modal Container */
.wgh-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

/* Modal Close Button */
.wgh-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.2s ease;
    opacity: 0.5;
    padding: 0;
    margin: 0;
}

.wgh-modal-close:hover {
    opacity: 1;
}

.wgh-modal-close span {
    color: #333;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Modal Content */
.wgh-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}

/* Modal Header */
.wgh-modal-header {
    text-align: center;
    padding: 20px 20px 20px;
    background: linear-gradient(135deg, #cbb49a 0%, #b79b7b 100%);
    color: #ffffff;
    margin: -20px -20px 20px;
}

.wgh-modal-header h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 400;
}

.wgh-modal-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
}

/* Modal Body */
.wgh-modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Product Info Section - Original */
.wgh-product-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* Product Info Section - Minimalist */
.wgh-product-info-minimal {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.wgh-product-info-minimal .wgh-product-image {
    width: 60px;
    flex-shrink: 0;
}

.wgh-product-info-minimal .wgh-product-image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.wgh-product-details-minimal {
    flex: 1;
    min-width: 0;
}

.wgh-product-details-minimal .wgh-product-name {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wgh-product-details-minimal .wgh-product-price {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.wgh-product-image {
    width: 150px;
}

.wgh-product-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wgh-product-details h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wgh-product-name,
.wgh-product-price {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1b1a1a;
}

/* Form Container - Original */
.wgh-form-container {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
}

/* Form Container - Minimalist */
.wgh-form-container-minimal {
    padding: 0;
}

.wgh-form-description {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* Form - Minimalist */
.wgh-form-minimal {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wgh-form-minimal .wgh-form-field {
    display: flex;
    flex-direction: column;
}

.wgh-form-minimal .wgh-form-field input,
.wgh-form-minimal .wgh-form-field textarea {
    padding: 12px 18px;
    border: 1px solid #e5e5e5;
    border-radius: 50px;
    font-size: 14px;
    line-height: 1.4;
    font-family: inherit;
    transition: border-color 0.2s;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
    box-shadow: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.wgh-form-minimal .wgh-form-field input {
    height: auto;
    min-height: 44px;
}

.wgh-form-minimal .wgh-form-field textarea {
    resize: vertical;
    min-height: 80px;
    border-radius: 20px;
}

.wgh-form-minimal .wgh-form-field input:focus,
.wgh-form-minimal .wgh-form-field textarea:focus {
    outline: none;
    border-color: #ccc;
    box-shadow: none;
}

.wgh-form-minimal .wgh-form-field input::placeholder,
.wgh-form-minimal .wgh-form-field textarea::placeholder {
    color: #999;
}

.wgh-form-minimal .wgh-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.wgh-form-minimal .wgh-form-actions {
    margin-top: 5px;
}

.wgh-form-minimal .wgh-submit-button {
    width: 100%;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wgh-form-minimal .wgh-submit-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.wgh-form-minimal .wgh-submit-button i {
    font-size: 16px;
}

.wgh-form-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.wgh-gift-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.wgh-form-header p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

/* Form Styles */
.wgh-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wgh-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.wgh-form-field {
    display: flex;
    flex-direction: column;
}

.wgh-form-field-full {
    grid-column: 1 / -1;
}

.wgh-form-field label {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.wgh-form-field label .required {
    color: #dc3545;
    margin-left: 3px;
}

.wgh-form-field input,
.wgh-form-field textarea {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.wgh-form-field input:focus,
.wgh-form-field textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wgh-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form Actions */
.wgh-form-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.wgh-submit-button {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 400;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wgh-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.wgh-submit-button:active {
    transform: translateY(0);
}

.wgh-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Response Messages */
.wgh-response {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.wgh-response.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wgh-response.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading State */
.wgh-submit-button.loading {
    position: relative;
    color: transparent;
}

.wgh-submit-button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wgh-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .wgh-modal-content {
        padding: 15px;
    }
    
    .wgh-modal-header {
        padding: 15px 15px 25px;
        margin: -15px -15px 20px;
    }
    
    .wgh-modal-header h2 {
        font-size: 22px;
    }
    
    .wgh-modal-header p {
        font-size: 14px;
    }
    
    .wgh-product-info {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
    
    .wgh-product-image {
        width: 120px;
    }
    
    .wgh-form-row {
        grid-template-columns: 1fr;
    }
    
    .wgh-form-header {
        flex-direction: column;
        text-align: center;
    }
    
    .wgh-gift-icon {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .wgh-modal-close {
        top: 8px;
        right: 12px;
        width: 28px;
        height: 28px;
    }
    
    .wgh-modal-close span {
        font-size: 22px;
    }
    
    .wgh-modal-header h2 {
        padding-right: 30px;
    }
    
    .wgh-gift-button {
        width: 100%;
        margin-top: 10px;
    }
    
    /* Prevent auto-zoom on iOS when focusing inputs */
    .wgh-form-minimal .wgh-form-field input,
    .wgh-form-minimal .wgh-form-field textarea {
        font-size: 16px;
    }
}
