/* Cef Kiremit Popup - Responsive Styles */

/* ===== Variables ===== */
:root {
    --cef-color: #c64c27;
    --cef-color-dark: #a83d1e;
    --cef-color-light: #d9683f;
    --cef-color-rgb: 198, 76, 39;
    --cef-font-body: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --cef-font-heading: 'Dosis', 'Barlow', sans-serif;
}

/* Honeypot - botlardan gizli */
.cef-kiremit-popup-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* Overlay */
.cef-kiremit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.cef-kiremit-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup Box */
.cef-kiremit-popup-box {
    position: relative;
    background: #ffffff;
    border-radius: 0;
    border-top: 4px solid var(--cef-color);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
    font-family: var(--cef-font-body);
}

.cef-kiremit-popup-overlay.active .cef-kiremit-popup-box {
    transform: translateY(0) scale(1);
}

/* Close Button */
.cef-kiremit-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
}

.cef-kiremit-popup-close:hover {
    background: #f0f0f0;
    color: var(--cef-color);
}

/* Header */
.cef-kiremit-popup-header {
    text-align: center;
}

.cef-kiremit-popup-title {
    font-family: var(--cef-font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--cef-color);
    margin: 0 0 10px 0;
    line-height: 1.3;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cef-kiremit-popup-desc {
    font-family: var(--cef-font-body);
    font-size: 15px;
    font-weight: 400;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Form */
.cef-kiremit-popup-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cef-kiremit-popup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cef-kiremit-popup-label {
    font-family: var(--cef-font-body);
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.cef-kiremit-popup-label .required {
    color: var(--cef-color);
}

.cef-kiremit-popup-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 0;
    font-family: var(--cef-font-body);
    font-size: 15px;
    font-weight: 400;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
    background: #fafafa;
}

.cef-kiremit-popup-input:focus {
    border-color: var(--cef-color);
    box-shadow: 0 0 0 3px rgba(var(--cef-color-rgb), 0.1);
    background: #ffffff;
}

.cef-kiremit-popup-input::placeholder {
    color: #bbb;
    font-family: var(--cef-font-body);
    font-weight: 400;
}

/* Consent Checkbox */
.cef-kiremit-popup-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-family: var(--cef-font-body);
    font-size: 13px;
    font-weight: 400;
    color: #777;
    cursor: pointer;
    line-height: 1.5;
}

.cef-kiremit-popup-consent input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--cef-color);
}

/* Submit Button */
.cef-kiremit-popup-submit {
    width: 100%;
    padding: 14px 24px;
    background: var(--cef-color);
    color: #ffffff;
    border: none;
    border-radius: 0;
    font-family: var(--cef-font-body);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cef-kiremit-popup-submit:hover {
    background: var(--cef-color-dark);
    transform: translateY(-2px);
}

.cef-kiremit-popup-submit:active {
    transform: translateY(0);
}

.cef-kiremit-popup-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Message */
.cef-kiremit-popup-message {
    text-align: center;
    font-size: 14px;
    padding: 0;
    min-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    border-radius: 0;
    font-family: var(--cef-font-body);
}

.cef-kiremit-popup-message.success {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 12px;
    border: 1px solid #c8e6c9;
}

.cef-kiremit-popup-message.error {
    color: var(--cef-color);
    background: #fbe9e4;
    padding: 12px;
    border: 1px solid #e8c4b8;
}

/* Floating Trigger Button */
.cef-kiremit-popup-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--cef-color);
    color: #ffffff;
    border: none;
    border-radius: 0;
    padding: 14px 24px;
    font-family: var(--cef-font-body);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(var(--cef-color-rgb), 0.4);
    z-index: 99998;
    transition: background 0.2s, transform 0.2s;
    display: none;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: cefPulse 2s infinite;
}

.cef-kiremit-popup-trigger:hover {
    background: var(--cef-color-dark);
    transform: scale(1.05);
}

.cef-kiremit-popup-trigger.visible {
    display: flex;
}

@keyframes cefPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(var(--cef-color-rgb), 0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(var(--cef-color-rgb), 0.4), 0 0 0 12px rgba(var(--cef-color-rgb), 0);
    }
}

/* Spinner */
.cef-kiremit-popup-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cefSpin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* ===== Responsive - Tablet ===== */
@media (max-width: 768px) {
    .cef-kiremit-popup-box {
        max-width: 100%;
        padding: 32px 24px;
    }

    .cef-kiremit-popup-title {
        font-size: 22px;
    }

    .cef-kiremit-popup-desc {
        font-size: 14px;
    }

    .cef-kiremit-popup-submit {
        font-size: 15px;
        padding: 13px 20px;
    }

    .cef-kiremit-popup-trigger {
        bottom: 16px;
        right: 16px;
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* ===== Responsive - Mobile ===== */
@media (max-width: 480px) {
    .cef-kiremit-popup-overlay {
        padding: 12px;
        align-items: center;
    }

    .cef-kiremit-popup-box {
        max-width: 100%;
        padding: 28px 20px;
        max-height: 92vh;
    }

    .cef-kiremit-popup-title {
        font-size: 20px;
    }

    .cef-kiremit-popup-desc {
        font-size: 13px;
    }

    .cef-kiremit-popup-input {
        padding: 11px 14px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .cef-kiremit-popup-trigger {
        bottom: 12px;
        right: 12px;
        padding: 11px 18px;
        font-size: 12px;
        max-width: calc(100% - 24px);
    }

    .cef-kiremit-popup-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
}

/* ===== Responsive - Small Mobile ===== */
@media (max-width: 360px) {
    .cef-kiremit-popup-box {
        padding: 24px 16px;
    }

    .cef-kiremit-popup-title {
        font-size: 18px;
    }
}
