/**
 * My Contact Form Pro - Frontend Styles
 * Fresh Design - Full Width, Ultra Responsive
 * Version: 2.0.0
 */

/* Reset & Base */
.mcf-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    box-sizing: border-box;
}

.mcf-container *,
.mcf-container *::before,
.mcf-container *::after {
    box-sizing: border-box;
}

/* Form Wrapper - Full Width with Gradient Border */
.mcf-form-wrapper {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 3px;
    position: relative;
    overflow: hidden;
}

.mcf-form-wrapper::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: mcf-shimmer 3s infinite linear;
}

@keyframes mcf-shimmer {
    0% { transform: translateX(-50%) translateY(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) translateY(-50%) rotate(360deg); }
}

/* Main Form Container */
.mcf-form {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    padding: 24px 20px;
    position: relative;
    z-index: 1;
}

/* Form Header - Compact */
.mcf-form-title {
    text-align: center;
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 800;
    margin: 0 0 4px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.mcf-form-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: clamp(12px, 3vw, 14px);
    margin: 0 0 20px 0;
    line-height: 1.3;
}

/* Form Grid Layout - 2 Columns on Larger Screens */
.mcf-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Form Group - Compact Design */
.mcf-form-group {
    margin-bottom: 0;
    position: relative;
}

/* Labels - Minimal & Clean */
.mcf-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mcf-label-icon {
    font-size: 14px;
    opacity: 0.8;
}

.mcf-required {
    color: #ef4444;
    font-weight: 700;
}

/* Input Fields - Compact & Full Width */
.mcf-input,
.mcf-textarea,
.mcf-file-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.mcf-input::placeholder,
.mcf-textarea::placeholder {
    color: #9ca3af;
    font-size: 13px;
}

.mcf-input:hover,
.mcf-textarea:hover {
    border-color: #c7d2fe;
}

.mcf-input:focus,
.mcf-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Textarea - Compact Height */
.mcf-textarea {
    min-height: 80px;
    max-height: 150px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
}

/* File Upload - Modern Compact Design */
.mcf-file-wrapper {
    position: relative;
    width: 100%;
}

.mcf-file-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.mcf-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px dashed #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #4b5563;
}

.mcf-file-label:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
}

.mcf-file-icon {
    font-size: 16px;
}

.mcf-file-text {
    font-weight: 500;
}

.mcf-file-info {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: center;
}

.mcf-selected-file {
    margin-top: 6px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 6px;
    font-size: 12px;
    color: #4338ca;
    display: none;
    animation: mcf-slideIn 0.2s ease;
}

@keyframes mcf-slideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* GDPR Checkbox - Compact */
.mcf-gdpr-group {
    padding: 10px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    border: 1px solid #f59e0b;
}

.mcf-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #92400e;
    line-height: 1.4;
}

.mcf-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 1px;
    accent-color: #667eea;
    cursor: pointer;
}

.mcf-checkbox-text {
    flex: 1;
}

/* Submit Button - Full Width & Prominent */
.mcf-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    margin-top: 16px;
}

.mcf-submit-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.4s ease;
}

.mcf-submit-btn:hover::before {
    left: 100%;
}

.mcf-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.mcf-submit-btn:active {
    transform: translateY(0);
}

.mcf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.mcf-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: mcf-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes mcf-spin {
    to { transform: rotate(360deg); }
}

/* Messages - Compact */
.mcf-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    animation: mcf-fadeIn 0.3s ease;
    display: none;
}

@keyframes mcf-fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.mcf-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #34d399;
}

.mcf-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #f87171;
}

/* Field Errors */
.mcf-field-error {
    color: #dc2626;
    font-size: 11px;
    margin-top: 3px;
    display: none;
    font-weight: 500;
}

.mcf-input.error,
.mcf-textarea.error {
    border-color: #ef4444;
    background: #fef2f2;
}

/* ==========================================
   RESPONSIVE DESIGN - Mobile First
   ========================================== */

/* Extra Small Devices (< 360px) - Ultra Compact */
@media (max-width: 359px) {
    .mcf-form {
        padding: 16px 12px;
    }
    
    .mcf-form-title {
        font-size: 18px;
    }
    
    .mcf-form-subtitle {
        font-size: 11px;
        margin-bottom: 14px;
    }
    
    .mcf-form-grid {
        gap: 10px;
    }
    
    .mcf-label {
        font-size: 10px;
    }
    
    .mcf-input,
    .mcf-textarea {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .mcf-textarea {
        min-height: 60px;
    }
    
    .mcf-file-label {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .mcf-submit-btn {
        padding: 12px 16px;
        font-size: 13px;
        margin-top: 12px;
    }
}

/* Small Devices (360px - 479px) - Compact */
@media (min-width: 360px) and (max-width: 479px) {
    .mcf-form {
        padding: 18px 14px;
    }
    
    .mcf-form-title {
        font-size: 20px;
    }
    
    .mcf-form-subtitle {
        margin-bottom: 16px;
    }
}

/* Medium Devices (480px - 639px) - Two Column for Name/Email */
@media (min-width: 480px) and (max-width: 639px) {
    .mcf-form {
        padding: 22px 18px;
    }
    
    .mcf-form-grid {
        gap: 14px;
    }
    
    /* Name and Email side by side */
    .mcf-form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

/* Tablets (640px - 899px) */
@media (min-width: 640px) and (max-width: 899px) {
    .mcf-form {
        padding: 28px 24px;
    }
    
    .mcf-form-title {
        font-size: 26px;
    }
    
    .mcf-form-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .mcf-form-grid {
        gap: 16px;
    }
    
    /* Two column layout for top fields */
    .mcf-form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
    
    .mcf-input,
    .mcf-textarea {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .mcf-submit-btn {
        padding: 16px 28px;
        font-size: 16px;
    }
}

/* Laptops & Desktops (900px - 1199px) */
@media (min-width: 900px) and (max-width: 1199px) {
    .mcf-form {
        padding: 32px 36px;
    }
    
    .mcf-form-title {
        font-size: 28px;
    }
    
    .mcf-form-subtitle {
        margin-bottom: 28px;
    }
    
    .mcf-form-grid {
        gap: 18px;
    }
    
    /* Three column layout for top row */
    .mcf-form-row-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }
    
    .mcf-form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

/* Large Screens (1200px+) */
@media (min-width: 1200px) {
    .mcf-form {
        padding: 36px 48px;
    }
    
    .mcf-form-title {
        font-size: 32px;
    }
    
    .mcf-form-subtitle {
        font-size: 15px;
        margin-bottom: 32px;
    }
    
    .mcf-form-grid {
        gap: 20px;
    }
    
    /* Three column layout */
    .mcf-form-row-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 18px;
    }
    
    .mcf-form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
    
    .mcf-input,
    .mcf-textarea {
        padding: 14px 18px;
        font-size: 15px;
    }
    
    .mcf-label {
        font-size: 13px;
    }
    
    .mcf-submit-btn {
        padding: 18px 32px;
        font-size: 17px;
    }
}

/* Extra Large Screens (1600px+) */
@media (min-width: 1600px) {
    .mcf-form {
        padding: 40px 56px;
    }
    
    .mcf-form-title {
        font-size: 36px;
    }
    
    .mcf-form-grid {
        gap: 24px;
    }
    
    .mcf-form-row-3 {
        gap: 20px;
    }
    
    .mcf-input,
    .mcf-textarea {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* Hover Effects - Only for Non-Touch Devices */
@media (hover: hover) {
    .mcf-form-group {
        transition: transform 0.2s ease;
    }
    
    .mcf-form-group:hover {
        transform: translateX(2px);
    }
    
    .mcf-form-group:hover .mcf-label {
        color: #667eea;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mcf-form-wrapper {
        padding: 2px;
    }
}

/* Landscape Mode for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .mcf-form {
        padding: 12px 16px;
    }
    
    .mcf-form-title {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .mcf-form-subtitle {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .mcf-form-grid {
        gap: 8px;
    }
    
    .mcf-form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .mcf-input,
    .mcf-textarea {
        padding: 8px 10px;
    }
    
    .mcf-textarea {
        min-height: 50px;
    }
    
    .mcf-submit-btn {
        padding: 10px 20px;
        margin-top: 10px;
    }
}

/* Print Styles */
@media print {
    .mcf-form-wrapper {
        background: none;
        padding: 0;
    }
    
    .mcf-form {
        background: white;
        box-shadow: none;
    }
    
    .mcf-submit-btn {
        display: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .mcf-form-wrapper::before,
    .mcf-submit-btn::before,
    .mcf-spinner {
        animation: none;
    }
    
    .mcf-form-group,
    .mcf-input,
    .mcf-textarea,
    .mcf-submit-btn,
    .mcf-file-label {
        transition: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mcf-form {
        background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    }
    
    .mcf-form-subtitle {
        color: #9ca3af;
    }
    
    .mcf-label {
        color: #e5e7eb;
    }
    
    .mcf-input,
    .mcf-textarea {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .mcf-input::placeholder,
    .mcf-textarea::placeholder {
        color: #6b7280;
    }
    
    .mcf-input:focus,
    .mcf-textarea:focus {
        background: #374151;
        border-color: #818cf8;
        box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
    }
    
    .mcf-file-label {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        color: #d1d5db;
    }
    
    .mcf-file-info {
        color: #6b7280;
    }
    
    .mcf-selected-file {
        background: linear-gradient(135deg, #312e81 0%, #3730a3 100%);
        color: #a5b4fc;
    }
    
    .mcf-gdpr-group {
        background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
        border-color: #b45309;
    }
    
    .mcf-checkbox-label {
        color: #fcd34d;
    }
    
    .mcf-success {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
        color: #6ee7b7;
        border-color: #10b981;
    }
    
    .mcf-error {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
        color: #fca5a5;
        border-color: #ef4444;
    }
}

/* Floating Labels Effect */
.mcf-floating-group {
    position: relative;
    margin-bottom: 0;
}

.mcf-floating-label {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    transition: all 0.2s ease;
    background: white;
    padding: 0 4px;
}

.mcf-input:focus + .mcf-floating-label,
.mcf-input:not(:placeholder-shown) + .mcf-floating-label,
.mcf-textarea:focus + .mcf-floating-label,
.mcf-textarea:not(:placeholder-shown) + .mcf-floating-label {
    top: -8px;
    left: 12px;
    font-size: 11px;
    color: #667eea;
    font-weight: 600;
}

/* Ripple Effect */
.mcf-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: mcf-ripple-animation 0.5s ease-out;
    background: rgba(255,255,255,0.4);
    pointer-events: none;
}

@keyframes mcf-ripple-animation {
    to {
        transform: scale(100);
        opacity: 0;
    }
}

/* Focus Visible for Accessibility */
.mcf-input:focus-visible,
.mcf-textarea:focus-visible,
.mcf-submit-btn:focus-visible,
.mcf-file-label:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Container Query Support (Future-Proof) */
@supports (container-type: inline-size) {
    .mcf-container {
        container-type: inline-size;
    }
    
    @container (min-width: 500px) {
        .mcf-form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
        }
    }
    
    @container (min-width: 800px) {
        .mcf-form-row-3 {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 16px;
        }
    }
}
