/* Modal Google Calendar - Estilo Appel */
.google-calendar-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.google-calendar-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.google-calendar-modal-header {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
    padding: 25px 30px;
    position: relative;
}

.google-calendar-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.google-calendar-modal-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.google-calendar-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.google-calendar-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Status da conexão */
.connection-status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(66, 133, 244, 0.1);
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(66, 133, 244, 0.2);
}

.status-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ccc;
    transition: all 0.3s ease;
}

.status-indicator.connected {
    background: #34a853;
    box-shadow: 0 0 10px rgba(52, 168, 83, 0.5);
}

.status-indicator.disconnected {
    background: #ea4335;
    box-shadow: 0 0 10px rgba(234, 67, 53, 0.5);
}

#status-text {
    font-weight: 500;
    color: #333;
}

/* Seções do modal */
.credentials-section,
.connect-section,
.calendars-section,
.disconnect-section {
    margin-bottom: 25px;
}

/* Grupos de formulário */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-group small a {
    color: #4285f4;
    text-decoration: none;
}

.form-group small a:hover {
    text-decoration: underline;
}

/* Botões */
.button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button-primary {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.button-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.button-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.button-danger {
    background: linear-gradient(135deg, #ea4335 0%, #dc3545 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(234, 67, 53, 0.3);
}

.button-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 67, 53, 0.4);
}

.button-small {
    padding: 8px 16px;
    font-size: 12px;
}

/* Botão de conexão Google */
.google-connect-btn {
    width: 100%;
    justify-content: center;
    padding: 15px 24px;
    font-size: 16px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
    transition: all 0.3s ease;
}

.google-connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.google-connect-btn img {
    border-radius: 4px;
}

/* Lista de calendários */
.calendars-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.calendar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.calendar-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.calendar-info {
    flex: 1;
}

.calendar-info strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 3px;
}

.calendar-info small {
    color: #666;
    font-size: 12px;
    font-family: monospace;
}

.calendar-actions {
    margin-left: 15px;
}

/* Botão de conexão no bloco existente */
.google-connect-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #d1e3f0;
}

.google-connect-button {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%) !important;
    border-color: #4285f4 !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.google-connect-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3) !important;
}

.connection-info {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

/* Responsividade */
@media (max-width: 768px) {
    .google-calendar-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .google-calendar-modal-header {
        padding: 20px;
    }
    
    .google-calendar-modal-header h3 {
        font-size: 20px;
    }
    
    .google-calendar-modal-body {
        padding: 20px;
    }
    
    .calendar-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .calendar-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .set-default-calendar {
        width: 100%;
        justify-content: center;
    }
}

/* Scrollbar personalizada */
.google-calendar-modal-body::-webkit-scrollbar {
    width: 8px;
}

.google-calendar-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.google-calendar-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.google-calendar-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
