/**
 * Page Time Limiter PRO - Frontend Styles
 * Versão 1.1.0 com barra de progresso, avisos e email capture
 */

/* ========== POPUP ORIGINAL ========== */
.ptl-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: ptlFadeIn 0.3s ease;
}

.ptl-popup-overlay.ptl-active {
    display: flex;
}

.ptl-popup {
    max-width: 500px;
    width: 90%;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    animation: ptlSlideUp 0.4s ease;
}

.ptl-popup-content {
    position: relative;
}

.ptl-popup-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.ptl-popup-message {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    opacity: 0.9;
}

.ptl-popup-message strong {
    font-weight: 700;
    font-size: 18px;
}

.ptl-popup-countdown {
    font-size: 48px;
    font-weight: 700;
    margin: 30px 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.ptl-popup-cta {
    display: inline-block;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ptl-popup-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ptl-popup-cta:active {
    transform: translateY(0);
}

body.ptl-no-scroll {
    overflow: hidden;
}

.ptl-popup-title:before {
    content: "⏰";
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
    animation: ptlPulse 2s ease infinite;
}

/* ========== BARRA DE PROGRESSO ========== */
.ptl-progress-bar {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999998;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 12px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ptl-progress-bar.ptl-progress-top {
    top: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ptl-progress-bar.ptl-progress-bottom {
    bottom: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.ptl-progress-content {
    max-width: 1200px;
    margin: 0 auto;
}

.ptl-progress-text {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.ptl-progress-icon {
    font-size: 18px;
    margin-right: 8px;
}

.ptl-progress-time {
    color: #0073aa;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    margin-left: 5px;
}

.ptl-progress-bar-container {
    height: 8px;
    background: #f0f0f1;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.ptl-progress-bar-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.5s ease;
    border-radius: 4px;
    position: relative;
}

.ptl-progress-bar-fill:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: ptlShimmer 2s infinite;
}

/* Cores baseadas no percentual */
.ptl-progress-bar-fill.ptl-progress-high {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
}

.ptl-progress-bar-fill.ptl-progress-medium {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.ptl-progress-bar-fill.ptl-progress-low {
    background: linear-gradient(90deg, #fa709a 0%, #fee140 100%);
}

/* ========== AVISOS PROGRESSIVOS ========== */
.ptl-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999997;
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(450px);
    transition: all 0.3s ease;
}

.ptl-warning.ptl-warning-show {
    opacity: 1;
    transform: translateX(0);
}

.ptl-warning-content {
    padding: 20px;
    position: relative;
}

.ptl-warning-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.2s;
}

.ptl-warning-close:hover {
    background: #f0f0f1;
    color: #333;
}

.ptl-warning-message {
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 15px;
    padding-right: 30px;
}

.ptl-warning-upgrade {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.ptl-warning-upgrade:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* Cores específicas por tipo de aviso */
.ptl-warning.ptl-warning-5min {
    border-left: 4px solid #f0ad4e;
}

.ptl-warning.ptl-warning-2min {
    border-left: 4px solid #e67e22;
}

.ptl-warning.ptl-warning-1min {
    border-left: 4px solid #e74c3c;
}

.ptl-warning.ptl-warning-1min .ptl-warning-message {
    font-weight: 600;
}

/* ========== EMAIL CAPTURE ========== */
.ptl-email-capture {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 2px dashed #dee2e6;
}

.ptl-email-capture h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.ptl-email-capture p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
}

#ptl-email-form {
    display: flex;
    gap: 10px;
}

#ptl-email-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    font-size: 15px;
    transition: all 0.2s;
}

#ptl-email-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

#ptl-email-form button {
    padding: 12px 25px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

#ptl-email-form button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.ptl-email-success {
    padding: 15px;
    background: #d4edda;
    color: #155724;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
}

/* ========== ANIMAÇÕES ========== */
@keyframes ptlFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes ptlPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes ptlShimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ========== RESPONSIVO ========== */
@media (max-width: 768px) {
    .ptl-progress-bar {
        padding: 10px 15px;
    }
    
    .ptl-progress-text {
        font-size: 12px;
    }
    
    .ptl-progress-time {
        font-size: 14px;
    }
    
    .ptl-warning {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .ptl-popup {
        padding: 30px 20px;
        width: 95%;
    }
    
    .ptl-popup-title {
        font-size: 24px;
    }
    
    .ptl-popup-message {
        font-size: 15px;
    }
    
    .ptl-popup-countdown {
        font-size: 36px;
        margin: 20px 0;
    }
    
    .ptl-popup-cta {
        padding: 14px 30px;
        font-size: 16px;
    }
    
    .ptl-email-capture {
        padding: 20px 15px;
    }
    
    #ptl-email-form {
        flex-direction: column;
    }
    
    #ptl-email-form button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ptl-progress-bar-container {
        height: 6px;
    }
    
    .ptl-warning-message {
        font-size: 14px;
    }
    
    .ptl-warning-upgrade {
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* ========== DARK MODE (opcional) ========== */
@media (prefers-color-scheme: dark) {
    .ptl-progress-bar {
        background: #1e1e1e;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .ptl-progress-text {
        color: #e0e0e0;
    }
    
    .ptl-progress-bar-container {
        background: #2a2a2a;
    }
    
    .ptl-warning {
        background: #2a2a2a;
    }
    
    .ptl-warning-message {
        color: #e0e0e0;
    }
    
    .ptl-email-capture {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .ptl-email-capture h3 {
        color: #e0e0e0;
    }
    
    .ptl-email-capture p {
        color: #b0b0b0;
    }
    
    #ptl-email-input {
        background: #1e1e1e;
        border-color: #3a3a3a;
        color: #e0e0e0;
    }
}
