/**
 * Forms Frontend Styles
 *
 * @package PupilCity\TestPlugin\Assets\CSS
 * @since 1.0.0
 */

/* Form Container */
.pct-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px solid #2aa5dc;
    position: relative;
    overflow: hidden;
}

.pct-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #2aa5dc;
}

/* Form Header */
.pct-form-header {
    margin-bottom: 30px;
    text-align: center;
}

.pct-form-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.pct-form-description {
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 16px;
}

/* Form Fields */
.pct-form-fields {
    margin-bottom: 30px;
}

.pct-form-field {
    margin-bottom: 25px;
    position: relative;
}

/* Modern Floating Label System */
.pct-form-field-modern {
    position: relative;
    margin-bottom: 2rem;
}

.pct-floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    padding: 0 4px;
    color: #666;
    font-size: 16px;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.pct-field-input:focus + .pct-floating-label,
.pct-field-input:not(:placeholder-shown) + .pct-floating-label,
.pct-field-input.has-value + .pct-floating-label {
    top: 0;
    font-size: 12px;
    color: #2aa5dc;
    font-weight: 600;
}

.pct-field-input:focus + .pct-floating-label {
    color: #2aa5dc;
}

.pct-form-field.has-error .pct-floating-label {
    color: #e7443a;
}

.pct-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.pct-required {
    color: #e74c3c;
    margin-left: 3px;
}

.pct-field-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #2aa5dc;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
    position: relative;
}

.pct-field-input:focus {
    outline: none;
    border-color: #2aa5dc;
    box-shadow: 0 0 0 3px rgba(42, 165, 220, 0.15);
    transform: translateY(-1px);
}

.pct-field-input:hover {
    border-color: #2aa5dc;
}

.pct-field-input:invalid {
    border-color: #2aa5dc;
}

.pct-field-input::placeholder {
    color: #999;
    opacity: 1;
}

/* Textarea */
textarea.pct-field-input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Select */
select.pct-field-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Checkbox */
.pct-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pct-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.pct-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

.pct-checkbox-text {
    line-height: 1.5;
}

/* Field Types - Email and Phone specific styles */

.pct-field-e_posta input {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3e%3c/path%3e%3cpolyline points='22,6 12,13 2,6'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.pct-field-phone input {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Field Errors */
.pct-field-error {
    margin-top: 5px;
    color: #e74c3c;
    font-size: 14px;
    display: none;
}

.pct-form-field.has-error .pct-field-input {
    border-color: #e7443a;
    box-shadow: 0 0 0 3px rgba(231, 68, 58, 0.15);
    animation: shake 0.5s ease-in-out;
}

.pct-form-field.has-error .pct-field-error {
    display: block;
    animation: slideDown 0.3s ease;
}

.pct-form-field.has-success .pct-field-input {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
}

.pct-form-field.has-success::after {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #27ae60;
    font-weight: bold;
    font-size: 18px;
    z-index: 2;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

/* Form Footer */
.pct-form-footer {
    text-align: center;
    margin-bottom: 20px;
}

.pct-submit-button {
    background: #2aa5dc;
    color: #fff;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(42, 165, 220, 0.4);
    position: relative;
    overflow: hidden;
}

.pct-submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    transition: left 0.5s ease;
}

.pct-submit-button:hover {
    background: #e7443a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 68, 58, 0.4);
}

.pct-submit-button:hover::before {
    left: 100%;
}

.pct-submit-button:active {
    transform: translateY(-1px);
}

.pct-submit-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pct-submit-button:disabled::before {
    display: none;
}

/* Form Messages */
.pct-form-messages {
    margin-top: 20px;
}

.pct-form-success,
.pct-form-error {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
}

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

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

/* Loading State */
.pct-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.pct-form.loading .pct-submit-button {
    position: relative;
}

.pct-form.loading .pct-submit-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .pct-form-container {
        margin: 10px;
        padding: 15px;
        border-radius: 6px;
    }
    
    .pct-form-title {
        font-size: 20px;
    }
    
    .pct-form-description {
        font-size: 14px;
    }
    
    .pct-field-input {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .pct-submit-button {
        width: 100%;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .pct-form-container {
        margin: 5px;
        padding: 10px;
    }
    
    .pct-form-field {
        margin-bottom: 20px;
    }
}



/* Print Styles */
@media print {
    .pct-form-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .pct-submit-button {
        display: none;
    }
    
    .pct-form-messages {
        display: none;
    }
}