/* Sistema de Redirecionamento WhatsApp - Estilos CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== LOGIN ===== */
.login-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    margin: 100px auto;
}

.login-container h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2.2em;
}

.login-container p {
    color: #666;
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

/* ===== HEADER ===== */
.header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    color: #667eea;
    font-size: 1.8em;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

/* ===== FORMULÁRIOS ===== */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

.form-actions {
    margin-bottom: 20px;
    text-align: right;
}

/* ===== SELETOR DE TIPO ===== */
.tipo-selector {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tipo-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 180px;
}

.tipo-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.tipo-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.tipo-option input[type="radio"]:checked + .tipo-label {
    font-weight: 700;
    color: #667eea;
}

.tipo-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.tipo-label {
    font-size: 15px;
    font-weight: 500;
    color: #555;
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-family: inherit;
}

.btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary {
    background: #667eea;
}

.btn-logout {
    background: #e74c3c;
    padding: 10px 20px;
    font-size: 13px;
}

.btn-logout:hover {
    background: #c0392b;
}

.btn-small {
    padding: 8px 15px;
    font-size: 12px;
    margin-right: 10px;
}

.btn-whatsapp {
    background: #25d366;
}

.btn-whatsapp:hover {
    background: #128c7e;
}

.btn-edit {
    background: #ffc107;
    color: #333;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    margin-bottom: 20px;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-grupo {
    background: #9b59b6;
}

.btn-grupo:hover {
    background: #8e44ad;
}

/* ===== MENSAGENS ===== */
.sucesso {
    background: #d4edda;
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.sucesso h3 {
    margin-bottom: 10px;
    color: #155724;
}

.sucesso a {
    color: #155724;
    text-decoration: underline;
}

.erro {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

/* ===== LINKS EXISTENTES ===== */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .links-grid {
        grid-template-columns: 1fr;
    }
}

.link-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.link-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.link-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.link-tipo {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.tipo-conversa {
    background: #e3f2fd;
    color: #1976d2;
}

.tipo-grupo {
    background: #f3e5f5;
    color: #7b1fa2;
}

.link-url {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.link-cliques {
    color: #666;
    font-size: 12px;
}

.link-item-grupo {
    border-left: 4px solid #9b59b6;
}

.link-grupo-url {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
    font-size: 12px;
}

.link-grupo-url:hover {
    text-decoration: underline;
}

.link-details p {
    margin-bottom: 8px;
    font-size: 13px;
}

.link-details strong {
    color: #555;
}

.link-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.sem-links {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
}

/* ===== PÁGINA DE REDIRECIONAMENTO ===== */
.redirect-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

.redirect-container.redirect-grupo {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.redirect-grupo .redirect-content h1 {
    color: #9b59b6;
}

.redirect-grupo .countdown {
    color: #9b59b6;
}

.redirect-grupo .progress-fill {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.redirect-content {
    background: white;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
}

.whatsapp-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.redirect-content h1 {
    color: #25d366;
    margin-bottom: 15px;
    font-size: 2em;
}

.redirect-content p {
    color: #666;
    margin-bottom: 10px;
    font-size: 16px;
}

.countdown {
    font-size: 3em;
    font-weight: bold;
    color: #25d366;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.redirect-info {
    color: #888;
    font-size: 14px;
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #25d366, #128c7e);
    width: 0%;
    transition: width 1s linear;
}

.app-button {
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 16px;
    background: #25d366;
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.app-button:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

/* ===== PÁGINA DE ERRO ===== */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h1 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.error-page p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .card {
        padding: 20px;
    }
    
    .redirect-content {
        padding: 30px 20px;
    }
    
    .countdown {
        font-size: 2.5em;
    }
    
    .whatsapp-icon {
        font-size: 3em;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: 50px auto;
        padding: 30px 20px;
    }
    
    .redirect-content {
        padding: 20px 15px;
    }
    
    .countdown {
        font-size: 2em;
    }
}
